Android 在首选项菜单中使用相对布局
我的应用程序中有首选项菜单。我使用的是安卓1.6。我想使用屏幕底部的静态保存按钮 我知道如何使用android:Layout\u alignParentBottom=“true”Android 在首选项菜单中使用相对布局,android,android-preferences,Android,Android Preferences,我的应用程序中有首选项菜单。我使用的是安卓1.6。我想使用屏幕底部的静态保存按钮 我知道如何使用android:Layout\u alignParentBottom=“true” 我们可以在相对布局中使用首选项,还是有其他实用的方法可以使用?您可以在选项卡式布局中使用首选项活动,这将是查询的实用方法。选项卡式布局应具有相对布局。。 在其中一个选项卡Host中,您可以通过intent使用首选项活动。。看起来很酷。 我不这样认为,您需要优先选择“保存”按钮。。如果您有首选项活动,它会自动保存首选
我们可以在相对布局中使用首选项,还是有其他实用的方法可以使用?您可以在选项卡式布局中使用首选项活动,这将是查询的实用方法。选项卡式布局应具有相对布局。。 在其中一个选项卡Host中,您可以通过intent使用首选项活动。。看起来很酷。 我不这样认为,您需要优先选择“保存”按钮。。如果您有首选项活动,它会自动保存首选项并在多个用户之间共享
<?xml version="1.0" encoding="utf-8"?>
<TabHost android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/tabhost"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<RelativeLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@android:id/tabs"
android:padding="5dp" />
<TabWidget
android:id="@android:id/tabs"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
</TabHost>
你能把首选项菜单布局xml也放进去吗?@havexz我想知道我们是否可以在相对布局中使用首选项检查一下,如果这是你想要的,谢谢havexz,我一定会尝试一下:)
<?xml version="1.0" encoding="utf-8"?>
<TabHost android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/tabhost"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<RelativeLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@android:id/tabs"
android:padding="5dp" />
<TabWidget
android:id="@android:id/tabs"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
</TabHost>