android ScrollView的用法,该如何解决
android ScrollView的用法
我想给activity加入滚动条,xml文件格式为
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView" android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/listlinear"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ListView
android:id="@id/android:list"
android:drawSelectorOnTop="false"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<TextView
android:id="@+id/neighborInfo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/buttonstart"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/buttonstop"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</ScrollView>
可是这样的结果是内容未全屏显示,则已经出现滚动条,致使内容未全屏显示,想实现内容大于屏幕时才出现滚动条,有人知道如何解决吗?
我想给activity加入滚动条,xml文件格式为
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView" android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/listlinear"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ListView
android:id="@id/android:list"
android:drawSelectorOnTop="false"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<TextView
android:id="@+id/neighborInfo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/buttonstart"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/buttonstop"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</ScrollView>
可是这样的结果是内容未全屏显示,则已经出现滚动条,致使内容未全屏显示,想实现内容大于屏幕时才出现滚动条,有人知道如何解决吗?
- 1android GPS 获取定位坐标信息解决方法
- 2Android带明白按钮的EditText
- 3android 语言定做
- 4ScrollView里嵌套ListView,怎么禁用ListView的滚动事件,或者触发ListView滚动时调用父元素ScrollView的滚动事件
- 5(原)Android理论梳理-No1异步处理之Handler相干机制
- 6listview 动态添加,该如何解决
- 7Android快速开发必不可少的11个工具类
- 8FBReaderJ学习笔记(3):Footer底部状态栏更改
- 9eclipse中怎么修改项目名称 具体操作
- 10Android学习笔记19:含有通知栏的进度条的Android下载文件