的高度尺寸我有內部的LinearLayout一堆的RelativeLayout的。這裏面會有ProgressBar和其他元素。Android的進度正在改變父母的LinearLayout
此刻的問題是,放置在內部的RelativeLayout當進度被延伸的父的LinearLayout的高度尺寸。
這裏是我有什麼基礎。
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1"
android:weightSum="2">
<RelativeLayout
android:id="@+id/timer1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/darker_gray">
<ProgressBar
android:layout_width="200dp"
android:layout_height="20dp"
style="@android:style/Widget.ProgressBar.Horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_centerInParent="true"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/timer2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/holo_blue_light"/>
</LinearLayout>
進度條看起來是由進度的高度上延伸父的LinearLayout的高度。當然不是想要的。
裸記住,上述的LinearLayout是內部的另一垂直的LinearLayout其中weightSum =「3」。所以這個高度的變形意味着所有的都不能垂直放入屏幕。
的一個缺陷可能我有我的想法是,因爲我還沒有完成的代碼(不把進度在三個級別),它只是一個怪癖。我會這樣做並報告回來。但在我看來,這似乎不是一件好事。
更改您的第一個相對佈局的_android:layout_height =「wrap_content」_。試試看,我不確定。 –