关于RelativeLayout设置垂直居中对齐不起作用的问题
来源:互联网 发布:淘宝网民族风帽子 编辑:程序博客网 时间:2024/04/24 08:55
直接上代码
1.原有代码:(红色字体部分不起作用,无法让RelativeLayout中的textview居中)
<RelativeLayout
android:id="@+id/autoquery_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
>
<TextView
android:id="@+id/autoquery_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/autoquery_tip"
/>
</RelativeLayout>
2.正确代码:(同样注意红色字体)
<RelativeLayout
android:id="@+id/autoquery_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/autoquery_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/autoquery_tip"
/>
</RelativeLayout>
- 关于RelativeLayout设置垂直居中对齐不起作用的问题
- 关于RelativeLayout设置垂直居中对齐不起作用的问题
- 关于RelativeLayout设置垂直居中对齐不起作用的问题
- 关于RelativeLayout设置垂直居中对齐不起作用的问题
- 关于RelativeLayout设置垂直居中对齐不起作用的问题
- 关于RelativeLayout设置垂直居中对齐不起作用的问题
- 关于RelativeLayout设置垂直居中对齐不起作用的问题
- 关于垂直居中的问题
- 关于文字垂直居中的设置
- 表单元素和文字垂直居中对齐的问题
- 关于css的水平垂直居中问题
- 关于html<td>垂直居中的问题
- RelativeLayout 居中对齐
- DIV实现垂直居中对齐的方法
- css垂直居中对齐的实现方式
- GridLayoutManager 设置居中对齐问题
- 关于HWM设置不起作用的问题
- UITextField垂直居中对齐
- Prezi安装中文字体找不到“com.prezi.PreziDesktop”文件夹的解决办法
- 打开了记得看垃圾卡拉斯就快乐
- 一个简单的全字查找与匹配方法
- POJ2586-Y2K Accounting Bug
- 学习 MySQL中导入 导出CSV
- 关于RelativeLayout设置垂直居中对齐不起作用的问题
- 阿里是打击哦啊及哦啊接哦i
- 虚拟局域网(VLAN)的配置
- 看到啦手机了骄傲滴偶奇偶
- POJ 3764 The xor-longest Path 字典树 异或性质
- 放款时间看了方式即可恢复健康上课了
- 看到沙发看好了就发货就爱看好看鸡蛋
- 发挥就看到沙发会员回复
- 转载---如何部署包含水晶报表的程序