Android layout 如何将customview和linearlayout放在同一个xml文件中
我的问题是,我在XML文件中使用一个自定义视图,同一个XML文件还包含其他组件,如文本视图、图像按钮、 该自定义视图包含我希望在背景上显示的图像 但它阻碍了我的整个布局和其他组件 我只能看到自定义视图 下面是我的代码Android layout 如何将customview和linearlayout放在同一个xml文件中,android-layout,textview,android,Android Layout,Textview,Android,我的问题是,我在XML文件中使用一个自定义视图,同一个XML文件还包含其他组件,如文本视图、图像按钮、 该自定义视图包含我希望在背景上显示的图像 但它阻碍了我的整个布局和其他组件 我只能看到自定义视图 下面是我的代码 <FrameLayout android:id="@+id/framelayout" android:layout_height="fill_parent" android:layout_width="fill_parent"> <com.abc.a
<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>
谁能告诉我如何在后台使用自定义视图和前台的其他组件吗。表示组件应显示在自定义视图上
提前准备好 请检查以下代码。我只添加了两个UI小部件,即文本视图和按钮。您可以根据需要添加更多
<?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>