2012-03-24 13 views
0

私の問題は、私のXMLファイルで1つのカスタムビューを使用していて、同じXMLファイルにテキストビュー、画像ボタンなどの他のコンポーネントが含まれていることです。同じXMLファイル内にcustomviewとlinearlayoutの両方を配置する方法

私は、バックグラウンド

にしたいが、それは

を(他のコンポーネント)を私の全体のレイアウトをブロックしていることカスタムビューは、画像が含まれていることを

、と私は唯一のカスタムビューを見ることができます

以下に私のコードです

<FrameLayout 
android:id="@+id/framelayout" 
android:layout_height="fill_parent" 
android:layout_width="fill_parent"> 

<com.abc.android.image 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:id="@+id/imageview"> 
</com.abc.android.image> 

<LinearLayout 
android:id="@+id/linlayout1" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/small1" 
android:orientation="vertical"> 

    All text view, ImageButtons 


</LinearLayout> 
</FrameLayout> 

誰でも、フォアグラウンドの背景や他のコンポーネントでカスタムビューを使用する方法を教えてください。コンポーネントがカスタムビュー上に表示される必要があることを意味します。

Thanx事前に。

答えて

0

次のコードを確認してください。私は2つのUIウィジェット、すなわちTextViewとボタンを追加しました。必要に応じて追加することができます。

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/linearlayout01" android:layout_height="fill_parent" 
android:layout_width="fill_parent"> 

<FrameLayout android:id="@+id/framelayout01" 
    android:layout_width="fill_parent" android:layout_height="fill_parent" 
    android:orientation="vertical"> 

    <ImageView android:layout_width="fill_parent" 
     android:layout_height="fill_parent" android:id="@+id/imageview01" 
     android:background="@drawable/pic"> 
    </ImageView> 

    <LinearLayout android:id="@+id/linearlayout02" 
     android:layout_width="fill_parent" android:layout_height="fill_parent" 
     android:orientation="vertical"> 

     <TextView android:text="Text View" android:layout_width="wrap_content" 
      android:layout_height="wrap_content" android:textSize="40dip" 
      android:textStyle="bold" android:layout_gravity="center" 
      android:layout_marginTop="50dip" android:textColor="#FF0000" /> 

     <Button android:text="Button" android:layout_width="fill_parent" 
      android:layout_height="80dip" android:gravity="center" 
      android:textSize="40dip" android:textStyle="bold" 
      android:layout_marginTop="50dip" /> 
    </LinearLayout> 

</FrameLayout> 

関連する問題