下面这段代码是放在一个RelativeLayout里面。
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/dispatch_transact_info_text3"
android:layout_alignLeft="@id/dispatch_transact_info_text3"
>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="vertical"
>
<TextView
android:id="@+id/dispatch_transact_info_text4"
android:layout_width="292px"
android:layout_height="312px"
android:background="@drawable/edit_content6"
android:paddingTop="15px"
android:paddingLeft="5px"
android:paddingRight="5px"
android:paddingBottom="5px"
style="@style/tvT3"
/>
</ScrollView>
</LinearLayout>
在系统自带的图形设计页面里,也可以看到有scrollBar,但是在显示内容的时候没有。
到底怎么回事?
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/dispatch_transact_info_text3"
android:layout_alignLeft="@id/dispatch_transact_info_text3"
>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="vertical"
>
<TextView
android:id="@+id/dispatch_transact_info_text4"
android:layout_width="292px"
android:layout_height="312px"
android:background="@drawable/edit_content6"
android:paddingTop="15px"
android:paddingLeft="5px"
android:paddingRight="5px"
android:paddingBottom="5px"
style="@style/tvT3"
/>
</ScrollView>
</LinearLayout>
在系统自带的图形设计页面里,也可以看到有scrollBar,但是在显示内容的时候没有。
到底怎么回事?
解决方案 »
- xml中的视图不见了,本来用得好好的,只有design和source了
- tabhost让选中项的文字的颜色变成白,如何实现呀,
- 如何用android实现像angry bird小鸟图片一样旋转?
- Fragment中添加菜单项和返回键的问题。大牛,救急
- 在Service中弹出Dialog
- 求大神求解脱 来看看我的代码
- 跪求个Android客户端对oracle增删改查的例子,或者给些详细指导也行
- 有朋友知道Android联系人姓名的"."在哪过滤掉的吗?
- 控件如何实现 阴影 + 按压切换背景图
- 求助,有没有哪位大佬帮我看一看
- Looper的使用问题---在什么时候用?
- Android 如何将raw资源中的数据库文件恢复?
楼主这里现实的是你的布局吗??
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="vertical">你的ScrollView 默认为要达到屏幕高度才会显示Scrollbar
你可以把android:layout_height="100dip"试试,效果就会出来。
、我还拿以前做的例子来看,没发现什么。
<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="@drawable/bg"
>
<include android:id="@+id/zl_headerBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
layout="@layout/topbar" />
<RelativeLayout
android:layout_width="307px"
android:layout_height="380px"
android:background="#FFFFFF"
android:layout_marginTop="7px"
android:layout_marginLeft="7px"
android:layout_marginRight="7px"
android:layout_marginBottom="7px"
>
<TextView
android:id="@+id/dispatch_transact_info_text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/file_title"
android:layout_marginLeft="7px"
android:layout_marginTop="9px"
style="@style/tvT2"
/>
<TextView
android:id="@+id/dispatch_transact_info_text2"
android:layout_width="200px"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/dispatch_transact_info_text1"
android:singleLine="true"
android:layout_marginLeft="7px"
android:layout_marginTop="9px"
android:text=""
style="@style/tvT2"
/>
<TextView
android:id="@+id/dispatch_transact_info_text3"
android:layout_width="86px"
android:layout_height="wrap_content"
android:text="@string/content"
android:layout_alignLeft="@id/dispatch_transact_info_text1"
android:layout_below="@id/dispatch_transact_info_text1"
android:layout_marginTop="9px"
android:gravity="center_horizontal"
style="@style/tvT2"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/dispatch_transact_info_text3"
android:layout_alignLeft="@id/dispatch_transact_info_text3"
>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="312px"
android:scrollbars="vertical"
>
<TextView
android:id="@+id/dispatch_transact_info_text4"
android:layout_width="292px"
android:layout_height="312px"
android:background="@drawable/edit_content6"
android:paddingTop="15px"
android:paddingLeft="5px"
android:paddingRight="5px"
android:paddingBottom="5px"
style="@style/tvT3"
/>
</ScrollView>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:id="@+id/dispatch_transact_info_button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_tab"
android:text="@string/attachment1"
android:layout_alignParentBottom="true"
style="@style/tv_tag"
/>
<ImageView
android:id="@+id/dispatch_transact_info_tag_divider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img_divider"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@id/dispatch_transact_info_button4"
/>
<Button
android:id="@+id/dispatch_transact_info_button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/btn_tab"
android:text="@string/transact_process"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@id/dispatch_transact_info_tag_divider"
style="@style/tv_tag"
/>
</RelativeLayout>
</LinearLayout>