这是我的HorizontalScrollView的XML
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="19" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/card_background" >
</RelativeLayout>
</LinearLayout>
</HorizontalScrollView>我想将RelativeLayout的宽度设置为等于HorizontalScrollView的宽度。如何使用XML (而不是以编程方式)完成此操作
发布于 2014-01-23 20:04:49
您所缺少的全部内容都在HorizontalScrollView中
android:fillViewport="true"发布于 2014-01-23 19:53:12
我会定义你想要设置给RelativeLayout的宽度,并将HorizontalScrollView的宽度和高度设置为wrap_content,这样就不是HorizontalScrollView定义宽度了,它只是包装它。
https://stackoverflow.com/questions/21307322
复制相似问题