要想达到这样的效果

Android ScrollView 使用注意事项Android ScrollView 使用注意事项

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scroller" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillViewport="true"><LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"><TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="6dip" android:paddingRight="6dip" android:paddingTop="6dip" android:textAppearance="?android:attr/textAppearanceMedium" android:text="Welcome to My Application"/><View android:layout_width="fill_parent" android:layout_height="1dip" android:background="#ff106510" android:layout_marginLeft="6dip" android:layout_marginRight="6dip" android:layout_marginTop="6dip" android:layout_marginBottom="12dip"/><TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0" android:paddingLeft="6dip" android:paddingRight="6dip" android:paddingBottom="6dip" android:text="@string/hello"/><LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:drawable/bottom_bar" android:gravity="center_vertical"><Button android:layout_width="0dip" android:layout_weight="1.0" android:layout_height="wrap_content" android:text="Accept"/><Button android:layout_width="0dip" android:layout_weight="1.0" android:layout_height="wrap_content" android:text="Refuse"/></LinearLayout></LinearLayout></ScrollView>
android:fillViewport. When set to true, this attribute causes the scroll view’s child to expand to the height of theScrollViewif needed. When the child is taller than theScrollView, the attribute has no effect.
set the android:layout_weight of the TextView to 1.0

更多相关文章

  1. QQ上的tabhost效果
  2. Android 使用View的旋转实现漂亮的动画效果
  3. Android使用贝塞尔线高仿QQ聊天消息气泡的拖拽效果
  4. android中图片倒影、圆角效果重绘
  5. android 图片文字轮播效果(图片和文字自动滚动)
  6. Android Gallery3D效果 教程 案例 代码
  7. 如何在Activity调用surfaceView实现透明或半透明的效果
  8. TextView属性android:ellipsize实现跑马灯效果,TextView内容过长

随机推荐

  1. Android学习笔记之源码下载打包
  2. android TextView XML的一些属性
  3. Android(安卓)Handler机制详解:在线程中新
  4. 英特尔® Android* USB 驱动程序安装指南
  5. android中刷新Invalidate和postInvalidat
  6. 解析Android中的XML
  7. Android(安卓)学习笔记——利用JNI技术在
  8. Android(安卓)XML解析学习——Dom方式
  9. Android中各种JAVA包的功能描述
  10. 安卓中一些常用的属性小结