0
Android的意见似乎是finicky。这似乎是滚动视图必须高度:Xamarin Android如何使用百分比高度滚动查看
高度=“WRAP_CONTENT”
才能正常工作,但这打乱了,因为我之前使用的想法重量总和,它当它是match_parent时占据了整个屏幕。无论如何仍然有滚动视图内的列表视图内的项目的百分比?或者选择一个例子,如果可能的话。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#DDDDDD"
android:descendantFocusability="beforeDescendants"
android:focusable="false"
android:focusableInTouchMode="true"
android:weightSum="100">
<ScrollView
android:layout_width="match_parent"
android:fillViewport="true"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="100">
<ImageButton
android:src="@android:drawable/ic_menu_gallery"
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@+id/image"
android:scaleType="fitXY"
android:layout_weight="30" /> ...
这里只是一个样本,因为它很长。该图像按钮Id喜欢占用30%左右的屏幕。