转自:http://blog.csdn.net/yanfangjin/article/details/7393023

在如下的xml配置文件中,起初对于android:layout_marginBottom,即需要控制imagebutton对于向下的间距,则不能working。

<RelativeLayout
        android:id="@+id/bar"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:background="@drawable/ic_bar_bg"
        android:layout_alignParentRight="true"
        android:orientation="horizontal" >

<ImageButton
            android:id="@+id/gallery"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="10dp"
            android:background="@drawable/ic_frame"/>

</RelativeLayout>

查看很多的blog,对于releated layout的设置有一定的了解,后续测试中,添加了如下的设置android:layout_alignParentBottom="true",则能够使用layout_marginBottom这个特性,因此认为默认的设置,alignParantBottom肯定是false,因此layout_marginBottom不起作用。

<RelativeLayout
        android:id="@+id/bar"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:background="@drawable/ic_bar_bg"
        android:layout_alignParentRight="true"
        android:orientation="horizontal" >

<ImageButton
            android:id="@+id/gallery"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="10dp"
            android:background="@drawable/ic_frame"/>

</RelativeLayout>

Android Layout XML属性研究--android:layout_marginBottom (转载)的更多相关文章

  1. Android--应用开发3(Android layout XML属性)

    Android layout XML属性 转载:http://www.cnblogs.com/playing/archive/2011/04/07/2008620.html Layout对于迅速的搭建 ...

  2. Android Layout XML属性

    转载自并做少量添加:http://www.cnblogs.com/playing/archive/2011/04/07/2008620.html Layout对于迅速的搭建界面和提高界面在不同分辨率的 ...

  3. 【Android UI】Android Layout XML属性

    Layout对于迅速的搭建界面和提高界面在不同分辨率的屏幕上的适应性具有很大的作用.这里简要介绍Android的Layout和研究一下它的实现. Android有Layout:FrameLayout, ...

  4. Android自定义XML属性以及遇到的命名空间的问题

    转载请注明出处:http://www.cnblogs.com/kross/p/3458068.html 最近在做一些UI,很蠢很蠢的重复写了很多代码,比如一个自定义的UI Tab,由一个ImageVi ...

  5. Android layout 布局 属性详解

    第一类:属性值 true或者 false           android:layout_centerHrizontal 水平居中     android:layout_centerVertical ...

  6. Android layout布局属性、标签属性总结大全

    RelativeLayout 第一类:属性值为true可false android:layout_centerHrizontal        水平居中 android:layout_centerVe ...

  7. android layout 布局属性

    控件属性: android属性 Android功能强大,界面华丽,但是众多的布局属性就害苦了开发者,下面这篇文章结合了网上不少资料, 第一类:属性值为true或false android:layout ...

  8. android 动画xml属性具体解释

    /** * 作者:crazyandcoder * 联系: * QQ : 275137657 * email: lijiwork@sina.com * 转载请注明出处! */ android 动画属性具 ...

  9. Android中控件属性详细总结(转载)

    转载地址:https://www.cnblogs.com/nanguojs/p/5950510.html 1.LinearLayout(线性布局): 可以分为水平线性:android:orientat ...

随机推荐

  1. Spring -- Bean自己主动装配&amp;Bean之间关系&amp;Bean的作用域

    对于学习spring有帮助的站点:http://jinnianshilongnian.iteye.com/blog/1482071 Bean的自己主动装配 Spring IOC 容器能够自己主动装配 ...

  2. SD卡读写之FileNotFoundException: /storage/emulated/0object.txt: open failed: ENOENT (No such file or dir

    读写sd卡中的文件依照例如以下步骤:1调用Environment的getExternalStorageState()方法推断手机上是否插入了sd卡.而且应用程序具有读写SD卡的能力 //假设手机已经插 ...

  3. docker on UP Board

    前言 原创文章,转载引用务必注明链接.水平有限,如有疏漏,欢迎指正. 本文使用Markdown写成,为获得更好的阅读体验和正常的图片.链接,请访问我的博客: http://www.cnblogs.co ...

  4. 2.6.2 用NPOI操作EXCEL--设置密码才可以修改单元格内容

    2.6.2 用NPOI操作EXCEL--设置密码       有时,我们可能需要某些单元格只读,如在做模板时,模板中的数据是不能随意让别人改的.在Excel中,可以通过“审阅->保护工作表”来完 ...

  5. 几个简单的程序看PHP的垃圾回收机制

    每一种计算机语言都有自己的自动垃圾回收机制,让程序员不必过分关心程序内存分配,php也不例外,但是在面向对象编程(OOP)编程中,有些对象需要显式的销毁,防止程序执行内存溢出. 一.PHP 垃圾回收机 ...

  6. 翻译:A Tutorial on the Device Tree (Zynq) -- Part V

    A Tutorial on the Device Tree (Zynq) -- Part V Application-specific data 之前提过,设备树中是一些特殊信息,这样一个驱动可以管理 ...

  7. u-boot简单学习笔记(一)

    一:Bootloader启动结构:      由于 Boot Loader 的实现依赖于 CPU 的体系结构,因此大多数 Boot Loader 都分为 stage1 和 stage2 两大部分.依赖 ...

  8. mysql语句:SET NAMES UTF8

    一直以来只知道mysql_query("SET NAMES UTF8");是设定数据库编码的,但是一直不清楚“SET NAMES UTF8”是什么. 直到今天才知道 SET NAM ...

  9. lint (software)

    lint (software) - Wikipedia https://en.wikipedia.org/wiki/Lint_(software) A linter or lint refers to ...

  10. STM32的低功耗设置

    因为产品需求,系统功耗是一个很重要的考虑方面.好好看下STM32F103的低功耗问题,以便编写驱动. 1.STM32的电源 1.1 STM32电源框图 上面的电源中需要注意的是后备供电区域,这个部分由 ...