社区
Android
帖子详情
android:layout_marginBottom使用方法
ghostgoodbye
2012-03-19 04:43:33
我想让一个button永远在界面的最下方,不随着上方内容的缩短而移动,请问这个应该怎么用,查了很多,这个都起不了作用
没分了 不好意思,
...全文
252
1
打赏
收藏
android:layout_marginBottom使用方法
我想让一个button永远在界面的最下方,不随着上方内容的缩短而移动,请问这个应该怎么用,查了很多,这个都起不了作用 没分了 不好意思,
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
a107494639
2012-03-19
打赏
举报
回复
使用相对布局
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button
android:id="@+id/edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="edit" />
</RelativeLayout>
Android
开发 在 Relative
Layout
中
android
:
layout
_
margin
Bott
om
设置的不起作用
最近开发中遇到了一个问题,在Relative
Layout
布局中: 1、当设置为
android
:
layout
_height="wrap_content"时,最下面的控件
layout
_
margin
Bott
om
属性无效,如果其他控件
使用
layout
_above让自己处于最下面的控件之上,那么
layout
_
margin
Bott
om
属性有效; 2、当设置为
android
:
layout
_height="match_parent"时,或者高度为固定值,那么最下面的控件
layout
_
margin
Bott
om
属性才会有效
android
:
layout
_
margin
Left等的简单用法
靠右显示:用
android
:
layout
_
margin
Left,意思是距离左边框的距离; 靠左显示:用
android
:
layout
_
margin
Right,意思是距离右边框的距离。 同理,
android
:
layout
_
margin
Top: 距离上边框
android
:
layout
_
margin
Bott
om
: 距离下边框 下面,是靠右显示的例子:
Android
Layout
XML属性研究--
android
:
layout
_
margin
Bott
om
在如下的xml配置文件中,起初对于
android
:
layout
_
margin
Bott
om
,即需要控制imagebutton对于向下的间距,则不能working。
android
:id="@+id/bar"
android
:
layout
_width="wrap_content"
android
:
layout
_height="fill_p
android
约束布局 兼容,app:
layout
_
margin
Bott
om
与
android
约束布局不兼容
有没有理由为什么以下
layout
_
margin
Bott
om
不起作用?但是,如果我在第二个视图上
使用
layout
_
margin
Top,它确实可以正常工作xmlns:
android
="http://schemas.
android
.c
om
/apk/res/
android
"xmlns:app="http://schemas.
android
.c
om
/apk/res-auto"
android
:
layout
_w...
android
Relative
Layout
中
android
:
layout
_
margin
Bott
om
的不起作用问题
Relative
Layout
布局中: 1、当设置为
android
:
layout
_height="wrap_content"时,最下面的控件
layout
_
margin
Bott
om
属性无效,如果其他控件
使用
layout
_above让自己处于最下面的控件之上,那么
layout
_
margin
Bott
om
属性有效。 2、当设置为
android
:
layout
_height="match
Android
80,349
社区成员
91,287
社区内容
发帖
与我相关
我的任务
Android
移动平台 Android
复制链接
扫一扫
分享
社区描述
移动平台 Android
android
android-studio
androidx
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章