[Android]RelativeLayout中最底的View其layout_marginBottom无效
来源:互联网 发布:网络变压器接法 编辑:程序博客网 时间:2024/05/29 15:25
处理一个Dialog,发现RelativeLayout布局下最后一个View的layout_marginBottom会失效.
效果图见:
解决方法为:
在最底的组件后面再加个View吧...
这个现象挺特别的,发帖记录一下。
xml布局如下:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:background="#80000000"><RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/dlgLayoutMain" android:paddingBottom="18dp" android:background="@drawable/micro_phone_dlg_bg"> <!-- 录音界面 --> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/txtMicroPhoneHint" android:layout_centerHorizontal="true" android:layout_marginTop="25dp" android:textSize="18.5sp" android:textColor="#ff555555" android:text="@string/micro_phone_what_2_say"/> <!-- 话筒、音波 --> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/img_micro_phone" android:background="@drawable/ic_launcher" android:layout_below="@id/txtMicroPhoneHint" android:layout_marginTop="15dp" android:layout_centerHorizontal="true"/> <Button android:layout_width="fill_parent" android:layout_height="36dp" android:id="@+id/btnPressed2Talk" android:text="@string/aio_press_speak_label" android:textSize="18.5sp" android:textColor="#ffffff" android:layout_below="@id/img_micro_phone" android:layout_marginLeft="18dp" android:layout_marginRight="18dp" android:layout_marginTop="12dp" android:layout_marginBottom="18dp" android:layout_centerHorizontal="true" android:background="#ff123456" /> <!-- 把下面的view注释掉,则发现btnPressed2Talk的marginBottom无效 --> <View android:layout_width="match_parent" android:layout_height="0dp" android:layout_below="@id/btnPressed2Talk" /></RelativeLayout></RelativeLayout>
- [Android]RelativeLayout中最底的View其layout_marginBottom无效
- 解决android:layout_marginBottom在RelativeLayout中无效的问题
- 解决android:layout_marginBottom在RelativeLayout中无效的bug
- 解决android:layout_marginBottom在RelativeLayout中无效的问题
- Android的RelativeLayout的view的layout_marginBottom不起作用
- Android的RelativeLayout的view的layout_marginBottom不起作用
- Android的RelativeLayout的view的layout_marginBottom不起作用
- ListView的item中RelativeLayout内view的layout_marginBottom无效的问题
- Android RelativeLayout中layout_marginBottom失效
- Android相对布局 layout_marginBottom无效
- RelativeLayout的layout_marginBottom属性失效问题
- RelativeLayout的layout_marginBottom属性失效问题
- layout_marginBottom无效
- layout_marginBottom 无效,解决办法
- android中android:layout_marginBottom的不起作用问题
- RelativeLayout中子view设置Margin无效
- Android:代码修改layout_marginBottom的属性
- ListView 中RelativeLayout 布局的 android:layout_above 无效的解决办法
- js操作json字符串实践
- LISTVIew 加分割线,scrollbar样式 以及其他
- uva 575 Skew Binary 吓唬人的超级大水题
- CSS----嵌入式样式表
- Hadoop1.x 源码修改编译执行
- [Android]RelativeLayout中最底的View其layout_marginBottom无效
- C语言图形函数
- C++中实现Singleton的正确方法
- 股指期货(Stock Index Future)
- 使用CSS解决不同浏览器的错位问题
- DCOM配置时右键属性不见的解决办法 .
- clojure配置repl端口和repo路径
- uva 579 ClockHands 几何初接触 求时针与分针的夹角
- http://tntxia.iteye.com/category/17690