2012-03-24 6 views
0

この相対レイアウトを使用して画面を設計しました。画像を右オートコンプリートテキストボックスに整列されるように、私は何をすべき変化相対レイアウトを使用してオーバーラップしないイメージボタンを作成する

<?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" > 

<AutoCompleteTextView 
    android:id="@+id/EditText01" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" /> 

<ImageButton 
    android:id="@+id/imageButton1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentTop="true" 
    android:layout_alignRight="@+id/EditText01" 
    android:src="@android:drawable/ic_notification_clear_all" /> 

<AutoCompleteTextView 
    android:id="@+id/EditText02" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_below="@+id/EditText01" /> 

<ImageButton 
    android:id="@+id/imageButton2" 
    android:layout_width="24dp" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_alignTop="@+id/EditText02" 
    android:src="@android:drawable/ic_notification_clear_all" /> 

。??事前に
おかげ..
P.S:私はpicture.Hereをアップロードするの評判を持っていないので、リンクhttp://i.stack.imgur.com/SRG9W.png

答えて

0

android:layout_alignRight="@+id/EditText01"があなたのボタンがEditTexts右端に揃え彼の右端を望んでいることを意味しています。あなたが実際に望むのは、左端のボタンがEditTextsの右端に揃えられていることです。それはandroid:layout_toRightOf="@+id/EditText01"

編集である - それはあなたが私が

<ImageButton 
    android:id="@+id/imageButton1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentTop="true" 
    android:src="@android:drawable/ic_notification_clear_all" /> 

<AutoCompleteTextView 
    android:id="@+id/EditText01" 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true" 
    android:layout_toLeftOf="@id/imageButton1" /> 

<ImageButton 
    android:id="@+id/imageButton2" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_below="@+id/EditText01" 
    android:src="@android:drawable/ic_notification_clear_all" /> 

<AutoCompleteTextView 
    android:id="@+id/EditText02" 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_alignRight="@+id/EditText01" 
    android:layout_below="@+id/EditText01" 
/> 
を推測したいものです
関連する問題