2011-06-28 12 views
4

私はグリッドビューを持っており、グリッドにイメージをロードし、そのイメージを選択するためのチェックボックスをロードします。私は背景として.9画像を使用して、各画像の罫線を表示します。画像とチェックボックスは、相対的なレイアウト内にあります。今私はすべてを試しましたが、チェックボックスwudはそれ自身を境界線と整列させません。ボーダーとチェックボックスは常にスペースがあります。これは、各画像のグリッドにロードされたビューです。相対レイアウト内のチェックボックスを整列する

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/imageLayout" 
android:gravity="top" android:layout_width="fill_parent" android:layout_height="fill_parent"> 
    <ImageView 
     android:id="@+id/image" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@drawable/back" 
     android:layout_gravity="center"> 
    </ImageView> 

    <CheckBox 
     android:id="@+id/checkbox" 
     android:button="@xml/checkbox" 
     android:background="@xml/checkbox_background" 
     android:layout_alignRight="@id/imageLayout" 
     android:layout_alignParentRight="true" android:layout_height="wrap_content" android:layout_width="wrap_content" > 

    </CheckBox> 
</RelativeLayout> 

私はそれができる方法はありますか?

編集沿ってスクリーンショットを添付:私は使用していた背景画像が

答えて

0

android:layout_alignRight="@id/image" 

android:layout_alignRight="@id/imageLayout" 

を交換しImageViewの背景に設定されている私は、あなたがたと思いますCheckBoxをアライメントできないため、ここでエラーが発生しますそれは親の相対レイアウトの右側にあります。

+0

私はすでにthtを試していますが、今でも同じことをやっています。あなたは間違って何を意味しますか?それはできません。 – khizar

関連する問題