我找不到一个在我看来标准的谈论我的问题的话题......这让我认为这是不可能的。但我尝试一下。
我有一个带有 9 个补丁背景的relativelayout(其中包含一个内容区域)。
是否可以将 TextView 相对于内容区域水平和/或垂直居中于此relativelayout内?
这个布局文件将完成任务
<?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:background="@drawable/background"
android:gravity="center" >
<TextView
android:id="@+id/txtTest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test TextView"
android:textColor="#000000" >
</TextView>
</RelativeLayout>
我使用的 9 块图像是
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)