Android底部栏,两个按钮背景不同,两个按钮背景相同

Android底部栏,两个按钮背景不同,两个按钮背景相同,android,Android,我的main.xml中有一个线性布局,它有一个listview。现在我想在listview下面创建一个底部栏 底部栏有一个背景图像和两个按钮及其各自的背景图像。我想把这两个按钮放在公共背景图像上 我已经读到,这可以通过使用FrameLayout来实现。但是,由于我在main.xml中使用LinearLayout作为基本布局,有没有办法使用LinearLayout进行此设计?这是一个简单地使用LinearLayout和使用权重来获得要显示的底部栏的示例 <?xml version="1.0"

我的main.xml中有一个线性布局,它有一个listview。现在我想在listview下面创建一个底部栏

底部栏有一个背景图像和两个按钮及其各自的背景图像。我想把这两个按钮放在公共背景图像上


我已经读到,这可以通过使用FrameLayout来实现。但是,由于我在main.xml中使用LinearLayout作为基本布局,有没有办法使用LinearLayout进行此设计?

这是一个简单地使用LinearLayout和使用权重来获得要显示的底部栏的示例

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:layout_weight="1"
android:background="#FF0000FF"
/>
<LinearLayout
android:layout_width="fill_parent" 
android:layout_height="100dip" 
android:orientation="horizontal"
android:layout_weight="1"
android:background="#FF00FF00"
>
    <Button
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_weight="1"
    android:text="Button 1"
    />  
    <Button
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_weight="1"
    android:text="Button 2"
    />      
</LinearLayout>
</LinearLayout>

这是一个简单地使用linearlayout和使用权重来获得要显示的底部栏的示例

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:layout_weight="1"
android:background="#FF0000FF"
/>
<LinearLayout
android:layout_width="fill_parent" 
android:layout_height="100dip" 
android:orientation="horizontal"
android:layout_weight="1"
android:background="#FF00FF00"
>
    <Button
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_weight="1"
    android:text="Button 1"
    />  
    <Button
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_weight="1"
    android:text="Button 2"
    />      
</LinearLayout>
</LinearLayout>

你可以考虑添加一些截图来更好地解释你提出的设计。代码> FrAMLayayOut/<代码>对你的情况毫无用处。你可以考虑添加一些截图来更好地解释你提出的设计。代码>框架布局对您的情况毫无用处。