控件的简单属性有时候可以解决不小麻烦 layout_alignRight
2016-02-02 16:23
369 查看
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="115dp" tools:context=".community.TopicDetailActivity"> <RelativeLayout android:id="@+id/layout" android:layout_gravity="center" android:layout_width="wrap_content" android:layout_height="match_parent"> <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginTop="15dp" android:layout_marginRight="15dp" android:scaleType="fitXY" android:src="@drawable/post_add_more_pic_bg" /> </RelativeLayout> <ImageButton android:id="@+id/btn_remove" android:layout_width="30dp" android:layout_height="30dp" android:background="@color/common_transparent" android:layout_alignRight="@+id/layout" android:src="@drawable/common_icon_remove" /> </RelativeLayout>
下面这种布局,如果如果不用layout_alignRight,很容易产生兼容问题,2.3系统和高版本不兼容(图片高度一定,宽度动态变化)
相关文章推荐
- 注解:xUtils之----ViewUtils
- 第十五章 提升用户体验 之 设计实现MVC controllers 和 actions
- unix网络编程str_cli的epoll实现
- [转]概率基础和R语言
- 2.1 Oracle架构基础
- Node.js v5.3.0个人翻译(一) --概要
- javascript对象的创建方式,原型,方法
- php 使用阿里云memcache存储session问题
- .9.png图片讲解
- 1.10 小结
- 手机上传图片
- 【Android】5分钟发布Android Library项目到JCenter
- git 启动命令
- 删除字符串中的控制字符(python)
- replace替换,js与C#的区别
- Map的底层结构及分析
- 近3年微软与谷歌的发展对比分析
- 在 Linux 中限制网络带宽使用(限制指定程序和指定网卡的流量)
- C++引用计数(reference counting)技术简介(2)
- mysql中select for update锁表的问题