Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/219.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在首选项菜单中使用相对布局_Android_Android Preferences - Fatal编程技术网

Android 在首选项菜单中使用相对布局

Android 在首选项菜单中使用相对布局,android,android-preferences,Android,Android Preferences,我的应用程序中有首选项菜单。我使用的是安卓1.6。我想使用屏幕底部的静态保存按钮 我知道如何使用android:Layout\u alignParentBottom=“true” 我们可以在相对布局中使用首选项,还是有其他实用的方法可以使用?您可以在选项卡式布局中使用首选项活动,这将是查询的实用方法。选项卡式布局应具有相对布局。。 在其中一个选项卡Host中,您可以通过intent使用首选项活动。。看起来很酷。 我不这样认为,您需要优先选择“保存”按钮。。如果您有首选项活动,它会自动保存首选

我的应用程序中有首选项菜单。我使用的是安卓1.6。我想使用屏幕底部的静态保存按钮

我知道如何使用android:Layout\u alignParentBottom=“true”



我们可以在相对布局中使用首选项,还是有其他实用的方法可以使用?

您可以在选项卡式布局中使用首选项活动,这将是查询的实用方法。选项卡式布局应具有相对布局。。 在其中一个选项卡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>