android:layout_with=,android – 难以理解layout_alignWithParentIfMissing
这仅适用于使用RelativeLayout时.
如果您将元素设置为一个其他元素,则表示该元素位于该元素的左侧.
但是如果这个元素会丢失,因为你删除它,例如它将与父对齐.
举个例子
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="102dp"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignWithParentIfMissing="true"
android:layout_alignBottom="@+id/textView1"
android:layout_toRightOf="@+id/textView1"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
看看会发生什么如果你删除textView1但不要触摸textView2.
它会到底部,左边(不正确,因为它在父母内部)
Android将相对于parent而不是元素定位元素,因为它是缺少的.
如果是与丢失元素相关的虚假参数将被忽略.
android:layout_with=,android – 难以理解layout_alignWithParentIfMissing相关推荐
- 【转】Android菜单详解——理解android中的Menu--不错
原文网址:http://www.cnblogs.com/qingblog/archive/2012/06/08/2541709.html 前言 今天看了pro android 3中menu这一章,对A ...
- Android菜单详解——理解android中的Menu
前言 今天看了pro android 3中menu这一章,对Android的整个menu体系有了进一步的了解,故整理下笔记与大家分享. PS:强烈推荐<Pro Android 3>,是我至 ...
- Android笔记一.深入理解Intent和IntentFilters(一)
深入理解Intent和IntentFiler(一) 转载请表明出处:http://blog.csdn.net/u012637501(嵌入式_小J的天空) 为了比較深刻的理解并灵活使用Inten ...
- 用Kotlin开发android平台语音识别语义理解应用
用Kotlin开发android平台语音识别,语义理解应用(olamisdk) 转载请注明CSDN博文地址:http://blog.csdn.net/ls0609/article/details/75 ...
- Android 关于RemoteViews的理解(一)
前言 RemoteViews从字面上理解是远程View,这个理解可能有点抽象,我们听过远程服务,但是远程View听说过的Android开发者应该很少,其实远程View和远程Service是一样的.谷歌 ...
- android remoteviews 设置背景,理解RemoteViews
理解RemoteViews 什么是remoteViews?按照字面意思是远程View,但RemoteViews并没有继承View,而是继承Object.它的作用是可以跨进程更新界面,听起来有点神奇.R ...
- Android 关于RemoteViews的理解(二)
前言 上一篇文章<Android 关于RemoteViews的理解(一)>介绍了RemoteViews的使用场景,我们学习东西的时候要知其然知其所以然.我之前考虑一篇文章就可以说明Remo ...
- Android 带你彻底理解 Window 和 WindowManager
有时候我们需要在桌面上显示一个类似悬浮窗的东西,这种效果就需要用 Window 来实现,Window 是一个抽象类,表示一个窗口,它的具体实现类是 PhoneWindow,实现位于 WindowMan ...
- 【Android】图像像素点理解
学而不思则罔,思而不学则殆 [Android]图像像素点理解 前言 图像处理 -ARGB初始 原图 Alpha R值测试 G值测试 B值测试 非R值测试 非G值测试 非B值测试 高级图片处理 取反1 ...
最新文章
- FPGA内部电源管理详解
- 只允许对象生成于堆内
- windows api 枚举进程pid
- scipy和statsmodels处理回归
- 荷兰警方错买300万欧元Office套件 法院:微软无需退款
- 安卓代码迁移:Program sh not found in PATH
- Windows下Zookeeper启动zkServer.cmd闪退问题的解决方案
- python symbols函数,Python
- JS推断浏览器类型与版本号
- 用python做一个上位机串口通信_如何用pyserial实现,通过上位机执行python程序从...
- 苹果笔记本链接刷卡打印机教程
- Vue官方文档代码大全
- 【场景化解决方案】ERP系统与钉钉实现数据互通
- ios苹果开发者账号申请流程(2017)
- thinkpad选择启动项_联系ThinkPad笔记本怎么设置第一启动项
- win10更新助手_快升级!win10精简版不到10G,比win7还干净流畅,无需更新!
- Android 使用腾讯X5 Webview浏览器拍照或从相册上传图片
- 情怀——推荐梁晓声新作《未死的沙威》
- 【刷题】BZOJ 2959 长跑
- 超级详细找CALL写CALL教程[转]