当AlertDialog里的内容很多时,就会看不到下面的内容,因为默认情况下,AlertDialog是没有滚动条的,无法滚动到下面去。今天eoe告诉大家怎样给AlertDialog加个垂直滚动条。 其实原理很简单,用绑定一个ScrollView的方式显示对话框内容。下面给出是xml布局代码: <?xml version="1.0" encoding="utf-8"?> <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/updatetv" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="10dip" android:textSize="20sp" /> </LinearLayout> </ScrollView> 复制代码