请教用代码表达一段xml布局文件 有些属性是根据不同lay_out 生效的。并不是说你能加进去而且没报错就能用。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 android:layout_gravity是LinearLayout的一个属性,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" ><FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayoutandroid:id="@+id/layout01"android:layout_width="fill_parent" android:layout_height="fill_parent" ><TextView android:id="@+id/text0" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top" android:textColor="#ffff0000" android:text="top" /> <TextView android:id="@+id/text1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:textColor="#ff00ff00" android:text="center" /> <TextView android:id="@+id/start" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ff0000ff" android:layout_gravity="bottom" android:text="bottom" /> </LinearLayout></FrameLayout> </RelativeLayout>这样试试,将3个TextView看做是一个整体 三楼dinjay,我的那个布局文件显示也没问题哦,支持android:layout_gravity,不过当我想通过代码来实现这一段布局文件时,却不行, 看了四楼dinjay的布局文件,奇怪,这个布局中的android:layout_gravity="center" 不再屏幕中心显示? 菜鸟关于安卓的一些疑问 Windowssp3+eclipse3.7.2安装adt16时有如下错误,大神求指导 关于listview遍历!! 求助图片发亮的问题 android新浪微博开发 如何实现提示字符串渐渐消失效果 请教android 如何获取应用占用存储和内存大小信息 我想使我的手机有root 权限. 但操作时,有以下提示,请问如何解决? 求大神帮解答 为什么打电话时总是强制退出 Android中sqlite使用哪个可视化工具可以存放图片啊?sqlite expert可以吗? 有一个tablerow 对象 如何copy 或者colne这个对象? 初学android ,请教2
<?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" ><FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="@+id/layout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/text0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:textColor="#ffff0000"
android:text="top"
/>
<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#ff00ff00"
android:text="center"
/>
<TextView
android:id="@+id/start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff0000ff"
android:layout_gravity="bottom"
android:text="bottom"
/>
</LinearLayout>
</FrameLayout> </RelativeLayout>
这样试试,将3个TextView看做是一个整体
?