Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.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 linearlayout未右对齐_Android_Android Fragments - Fatal编程技术网

android linearlayout未右对齐

android linearlayout未右对齐,android,android-fragments,Android,Android Fragments,我有一个类似这样的例子: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" a

我有一个类似这样的例子:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    <android.support.v7.widget.Toolbar
        android:id="@+id/menu_toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?android:attr/colorBackgroundFloating"
        android:minWidth="600dp"
        app:contentInsetStart="0dp"
        android:elevation="2dp">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="end">
            <Button
                android:id="@+id/confirm_button"
                style="?android:attr/buttonBarStyle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@null"
                android:text="Confirm"
                android:textAllCaps="false" />
            <Button
                style="?android:attr/buttonBarStyle"
                android:id="@+id/reset_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@null"
                android:text="Reset"
                android:textAllCaps="false" />
        </LinearLayout>
    </android.support.v7.widget.Toolbar>

    <FrameLayout
        android:id="@+id/prefer_tags"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp" />

    <FrameLayout
        android:id="@+id/exclude_tags"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp" />
</LinearLayout>

如何始终将按钮保持在右侧?

尝试更换按钮

android:layout\u width=“match\u parent”
android:gravity=“结束”

android:layout\u width=“wrap\u content”
android:layout_gravity=“end”