<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@color/RED"
tools:context=".MainActivity" > <HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/BLUE"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/GREEN"
>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/YELLOW"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:text="@string/hello_world"
/>
</RelativeLayout>
</HorizontalScrollView></RelativeLayout>
我希望绿色盖掉蓝色,按钮在右下角,或者绿色比蓝色的区域还宽,按钮在右边的屏幕之外,通过左右的滚动条才能拉到。问题在哪里呢?
解决方案 »
- android sqlite 时间差
- 关于Timer的一个基础问题
- android程序打开ttyUSB0无读权限
- 如何通过按钮而非回退键返回栈中之前的某个activity
- 如何实现图中效果?
- 一个关于动画的问题,大家进来看看
- 游戏地图如何实现不停的向上或向下移动
- Android录制的amr,3gp格式的文件可以用开源库libmp3lame直接转换成mp3格式的吗?
- RadioButton为什么没有setMargin属性
- '<>'operator is not allowed for source level below 1.7
- Android 多点触控和单点触控同时进行的问题
- Android string.xml 显示特殊符号
内容大小超过容器大小才会出现滚动条的。
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/BLUE"
>
android:background="@color/BLUE"改为 android:background="@color/green"
在 <HorizontalScrollView></HorizontalScrollView>之间多加一个空的
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/GREEN"
>