首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android 相对布局的有关问题!

2013-01-25 
android 相对布局的问题!!!RelativeLayout xmlns:androidhttp://schemas.android.com/apk/res/android

android 相对布局的问题!!!
<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="@color/brown"
    >
    <EditText 
    android:id="@+id/ee"
    android:layout_width="200dip"
    android:layout_height="wrap_content"
    />
    <TextView 
    android:id="@+id/tt"
    android:layout_width="200dip"
    android:layout_height="wrap_content"
    android:layout_above="@id/ee"
    android:background="@color/darkgray"
    android:text="123123"
    />
    
</RelativeLayout>

为什么TextView没有在EditText的上面???????

不要说把EditText放到TextView的下面!!!!!!!!
[解决办法]
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
     <EditText 
     android:id="@+id/ee"
    android:layout_width="200dip"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
     />
     <TextView 
     android:id="@+id/tt"
    android:layout_width="200dip"
    android:layout_height="wrap_content"
    android:layout_above="@id/ee"
    android:text="123123"
     />
    
</RelativeLayout>
这样可以

热点排行