Android ListView端索引没有';不合适的屏幕
在Android开发中,我有一个Android ListView端索引没有';不合适的屏幕,android,listview,Android,Listview,在Android开发中,我有一个线性布局,如下所示: <?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:orientati
线性布局
,如下所示:
<?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="horizontal">
<ListView
android:id="@android:id/list"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:paddingRight="0dp"/>
<TextView
android:id="@+id/text_inprogress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Congress API"/>
<LinearLayout
android:id="@+id/side_index"
android:layout_width="50dp"
android:layout_height="fill_parent"
android:background="#c3c3c3"
android:gravity="center_horizontal"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>
和索引项
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/side_list_item"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center"
android:padding="3dp"
android:textSize="12sp" />
我在右边有一个边索引。它是A到Z。但是,实际的UI只显示A到V,因为没有足够的空间。每个项目的填充为3。如何使侧面索引适合屏幕
如果我在索引项文本视图中将填充改为1dp,它将变得太小。我想要的是自动适应屏幕的一面。我怎样才能做到
让线性布局能够垂直滚动怎么样?如果答案是肯定的,那么继续在linearlayout之外添加一个滚动视图~让linearlayout能够垂直滚动怎么样?如果答案是肯定的,那么继续并在linearlayout之外添加一个滚动视图~