I’m currently trying to place a progress bar on the top left corner of my screen. However, I’m not quite sure which way is the best way to do it. Should I create a progress bar programatically instead of creating it in the xml? Or should I change my layout around? Thanks. XML below.
XML CODE:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:focusableInTouchMode="true"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="53dp"
android:layout_marginBottom="5dp"
android:src="@raw/topbar" />
<TextView
android:id="@+id/search_nameOfFeed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:text="Event Name"
android:textColor="@color/black"
android:textSize="18sp" >
</TextView>
<ListView
android:id="@+id/searchfeed_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.83"
android:dividerHeight="10.0sp"
android:fadingEdge="none"
android:stackFromBottom="false"
android:transcriptMode="normal" >
</ListView>
</LinearLayout>
The best option for layout when you’re wanting to position views in specific areas is
FrameLayoutorRelativeLayoutRelativeLayoutwill allow you to place each view relative to each other.FrameLayoutallows you to stack views in a z-index positioning.Play with both and you may come up with results you’re looking for.