2011-01-13 40 views
1

整個上午一直在努力將 進度條放置在「正在進行模擬」文本下。 任何人都可以幫我嗎? 添加圖片:alt textandroid remoteView佈局不起作用

<?xml version="1.0" encoding="UTF-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:orientation="horizontal" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:padding="3dp" 
      > 
<ImageView android:id="@+id/image" 
      android:layout_width="wrap_content" 
      android:layout_height="fill_parent" 
      android:layout_marginRight="10dp" 
      /> 
<TextView android:id="@+id/text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:textColor="#000" 
      /> 
<ProgressBar 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      style="?android:attr/progressBarStyleHorizontal" 
      android:id="@+id/status_progress" 
      android:max="100" 
      /> 
</LinearLayout> 

回答

2

下面是一個選項,如果你不想使用RelativeLayout的,其他答案的建議。

<?xml version="1.0" encoding="UTF-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:orientation="horizontal" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:padding="3dp" 
      > 
<ImageView android:id="@+id/image" 
      android:layout_width="wrap_content" 
      android:layout_height="fill_parent" 
      android:layout_marginRight="10dp" 
      /> 
<LinearLayout 
      android:orientation="vertical" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:padding="3dp" 
      > 
     <TextView android:id="@+id/text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:textColor="#000" 
      /> 
     <ProgressBar 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      style="?android:attr/progressBarStyleHorizontal" 
      android:id="@+id/status_progress" 
      android:max="100" 
      /> 
</LinearLayout> 
</LinearLayout> 
1

試試這個

<?xml version="1.0" encoding="UTF-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:orientation="horizontal" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:padding="3dp" 
      > 
<ImageView android:id="@+id/image" 
      android:layout_width="wrap_content" 
      android:layout_height="fill_parent" 
      android:layout_marginRight="10dp" 
      /> 
<TextView android:id="@+id/text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:textColor="#000" 
      android:layout_below="@+id/image"/> 
<ProgressBar 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      style="?android:attr/progressBarStyleHorizontal" 
      android:id="@+id/status_progress" 
      android:max="100" 
      /> 
      </RelativeLayout> 
+0

只是給你一個使用RelativeLayout屬性的想法。 – 2011-01-13 13:15:37

+0

但是我應該在問題中理解android:layout_below屬性應該用在ProgressBar中,以便將它放在TextView下。 – Adinia 2011-01-13 13:17:37