0
我真的試圖創建以下佈局: 如何正確顯示SeekBar? (layout_weight)
<?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:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</TextView>
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</TextView>
<SeekBar
android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</TextView>
</LinearLayout>
我想要一份給父佈局到textView1和textView2的80%,包裝搜索欄儘可能和剩餘空間給textView3。
I`ve試圖:
- 使用layout_weight屬性(分別 - 4,4,1,1),但在過去 視圖重疊搜索欄僅
- 使用佈局重量textView1和textView2 ,將SeekBar的高度設置爲「wrap_content」並將最後一個視圖設置爲「match_parent」
現在我沒有更多的想法。你有過這樣的問題嗎?
太棒了!謝謝!它完美的作品。但是......你能告訴我爲什麼它有效嗎? SeekBar的空間是否首先確定(因爲它沒有任何權重)?然後其餘的按重量劃分? – ppablo28 2013-03-17 15:40:10