android给ScrollView中显示多个控件 --公司项目 在左边栏 加入滚条
2011-08-29 17:51
281 查看
http://blog.csdn.net/sereneWorkshop/article/details/5250795
在左边栏 ,加入 侧边 栏 滚条
--------------------------------------------------------------------------------以上是测试案例,一下是 项目中 解决自己问题的做法
将 ScrollView套在 left_layout 外面, 将 左边的 的布局 RelativLayout 的 想对布局 改为 ScrollView
因为 left_layout 中 有 backGround 所以 使得 滚条过长,所以再将 backgroud 去掉
哈哈,今天的任务完成
<?xml version="1.0" encoding="UTF-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_width="fill_parent" android:scrollbars="vertical" android:background="#FF000000"> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFc0c0c0" android:padding="10dip"> <TextView android:id="@+id/about_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/about_text" android:textColor="#FF000000" android:autoLink="all" android:textSize="20sp"/> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center"> <ImageButton android:layout_gravity="center" android:id="@+id/about_exit" android:src="@drawable/looks" android:background="#FF46333c" android:scaleType="center" android:layout_width="wrap_content" android:layout_height="fill_parent" android:text="@string/about_ok"/> <TextView android:id="@+id/about_text_exit" android:layout_height="fill_parent" android:layout_width="wrap_content" android:background="#FF46333c" android:text="Let's Go!" android:layout_toRightOf="@id/about_exit" android:layout_alignTop="@id/about_exit" android:layout_alignBottom="@id/about_exit" android:clickable="true"/> </RelativeLayout> </LinearLayout> </ScrollView> </LinearLayout>
在左边栏 ,加入 侧边 栏 滚条
<!-- 左边 块 --> <!-- Alex --> <ScrollView android:layout_height="wrap_content" android:id="@+id/Left_layout_ScrollV" android:layout_width="wrap_content" android:layout_below="@+id/top" android:layout_above="@+id/bottom" > <RelativeLayout android:id="@+id/left_layout" android:background="@+drawable/filter_back" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent"> </RelativeLayout> </ScrollView>
--------------------------------------------------------------------------------以上是测试案例,一下是 项目中 解决自己问题的做法
将 ScrollView套在 left_layout 外面, 将 左边的 的布局 RelativLayout 的 想对布局 改为 ScrollView
因为 left_layout 中 有 backGround 所以 使得 滚条过长,所以再将 backgroud 去掉
<!-- 左边 块 --> <!-- Alex 将背景图 去掉 就解决过长的问题 了 android:background="@+drawable/filter_back"--> <ScrollView android:id="@+id/Left_layout_ScrollV" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/top" android:layout_above="@+id/bottom" android:fillViewport="true" > <RelativeLayout android:id="@+id/left_layout" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="10dp" > </RelativeLayout> </ScrollView>
哈哈,今天的任务完成
相关文章推荐
- android给ScrollView中显示多个控件
- 【Android---项目中】ScrollView中镶嵌ListView,ListView只显示一行的解决方案
- android ListView显示多个类型item 和 item中控件抢夺焦点解决办法
- android ListView显示多个类型item 和 item中控件抢夺焦点解决办法
- android 关于listview scrollview 底部 控件无法显示的两个解决方案
- Android-ScrollView中listview控件高度正确显示
- Android中PopupWindow显示在控件的左边
- Android之ScrollView滚动布局控件使用以及显示新闻网页
- android 解决ScrollView嵌套ListView的问题,不能全屏,全屏不能显示下面控件
- 【Android 开发】:UI控件之 ScrollView垂直滚动控件 和 HorizontalScrollView水平滚动控件的使用
- Android studio多个项目之间怎么实现快速切换?
- Android:UI控件scrollView、TabHost
- Xcode 编辑窗口左边的小圆圈不能点击问题 显示关联控件
- Android开发,超出屏幕范围的控件显示解决办法
- Android控件显示/隐藏时添加动画:ViewSwitcher
- Android中在控件上显示倒计时
- android ScrollView嵌套viewpager,viewpager嵌套gridview,解决内嵌无法显示的问题
- Android中ScrollView嵌套GridView,解决GridView显示不全的问题
- android(2):添加控件与显示问题+功能直接的关系
- QT5-控件-QScrollArea-可以用于把一个窗口分割为多个-比如根据图片大小显示滚动条