RT

RelativeLayout中,如果将 TextView的
android:layout_height=”wrap_content”
android:layout_centerVertical=”true”
之后,其他的控件的android:layout_below等属性全部失效

发现限制行数也无效
最后时候minHeight解决问题

<TextView     android:id="@+id/view_top_user_info_nickname"     style="@style/x_standard_text_5"     android:layout_width="match_parent"     android:layout_height="wrap_content"     **android:minHeight="30dp"**     android:layout_centerVertical="true"     android:singleLine="true"     android:textColor="@color/standard_black" /><TextView    android:id="@+id/view_top_user_info_signature"    style="@style/x_standard_text_6"    android:layout_width="match_parent"    android:layout_height="wrap_content"    android:layout_below="@id/view_top_user_info_nickname"    android:singleLine="true"    android:text="asdfadfadf啊啊士大夫撒的发撒撒的发阿斯蒂芬asd啊"    android:textColor="@color/standard_gren_1" />

网上有朋友说将:

RelativeLayout布局的layout_height属性设置为match_parent即可!
即使外层有LinearLayout使用layout_weight平分空间,它的match_parent也不会撑大外层LinearLayout的空间的。
当初想设置wrap_content,其实就是怕内部的RelativeLayout设置match_parent后会被撑大而已,实践证明,多虑了!
http://www.th7.cn/Program/Android/201410/297261.shtml
但是这样修改对布局影响较大,所有我没有采纳

更多相关文章

  1. Android之activity属性汇总
  2. Android 布局属性全解(初学者必学)
  3. TextView 属性详解
  4. Android卡片式列表布局
  5. Android XML布局报错:android/view/View$OnUnhandledKeyEventList
  6. android布局layout中的一些属性
  7. Android——EditText【输入框】的所有属性和常用属性归纳

随机推荐

  1. Android中的Selector的使用
  2. android KEYCODE_BACK监听处理
  3. How to install Android SDK in Ubuntu S
  4. android textView描边
  5. How to Cross Compile the Bash shell fo
  6. 在android中创建包含对象数组对象List 的
  7. Android system大小上限设置
  8. Android的SensorEventListener例子(摇晃手
  9. Android(Java):md5加密
  10. Android Studio 报错: Failed to complete