的高度尺寸我有内部的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”_。试试看,我不确定。 –