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

android中控件的遮盖有关问题

2012-09-03 
android中控件的遮盖问题如下:会造成imagebutton被遮盖?xml version1.0 encodingutf-8?RelativeL

android中控件的遮盖问题

如下:会造成imagebutton被遮盖

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
??? android:orientation="vertical"
??? android:layout_width="fill_parent"
??? android:layout_height="fill_parent"
??? android:background="#ffffff"
??? >
??? <ImageButton
??? ?android:id="@+id/proper_scan_result_refresh"
??????? android:layout_width="wrap_content"
??????? android:layout_height="wrap_content"
??????? android:background="@drawable/refresh"
??????? android:layout_marginTop="3dip"
??????? android:layout_marginRight="5dip"
??????? android:layout_alignParentRight="true"
??? />
??? <TextView
? ??android:id="@+id/proper_scan_result_title"
??????? android:layout_width="fill_parent"
??????? android:layout_height="wrap_content"
??????? android:text="请您选择要连接的网络"
??????? style="?android:attr/textAppearanceLarge"
??????? android:textColor="#3a3a3a"
??????? android:paddingLeft="10dip"
??????? android:gravity="left|center_vertical"
??????? android:background="@drawable/system_title_bg"
??? />

</RelativeLayout>

?

?

但如果这样写,则imagebutton会浮在textview之上

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
??? android:orientation="vertical"
??? android:layout_width="fill_parent"
??? android:layout_height="fill_parent"
??? android:background="#ffffff"
??? >
??? <TextView
? ??android:id="@+id/proper_scan_result_title"
??????? android:layout_width="fill_parent"
??????? android:layout_height="wrap_content"
??????? android:text="请您选择要连接的网络"
??????? style="?android:attr/textAppearanceLarge"
??????? android:textColor="#3a3a3a"
??????? android:paddingLeft="10dip"
??????? android:gravity="left|center_vertical"
??????? android:background="@drawable/system_title_bg"
??? />
??? <ImageButton
??? ?android:id="@+id/proper_scan_result_refresh"
??????? android:layout_width="wrap_content"
??????? android:layout_height="wrap_content"
??????? android:background="@drawable/refresh"
??????? android:layout_marginTop="3dip"
??????? android:layout_marginRight="5dip"
??????? android:layout_alignParentRight="true"
??? />

</RelativeLayout>

热点排行