Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.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_Xml_Android Layout_Vertical Alignment - Fatal编程技术网

Android 如何将按钮布局从水平更改为垂直?

Android 如何将按钮布局从水平更改为垂直?,android,xml,android-layout,vertical-alignment,Android,Xml,Android Layout,Vertical Alignment,我正在翻译一个中文应用程序,我想将底部按钮的布局从水平改为垂直,以便正确地适应翻译。我一直在玩线性布局和CheckedTextView中的方向和重力,但按钮始终保持水平 这是xml代码 <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:orientation="vertical" android:background="@drawable/homepage_ground" android:layou

我正在翻译一个中文应用程序,我想将底部按钮的布局从水平改为垂直,以便正确地适应翻译。我一直在玩线性布局和CheckedTextView中的方向和重力,但按钮始终保持水平

这是xml代码

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical"
android:background="@drawable/homepage_ground"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     xmlns:android="http://schemas.android.com/apk/res/android" xmlns:nav_stick="http://schemas.android.com/apk/res-auto">
<include layout="@layout/title_bar_transparent_white" />
<RelativeLayout android:layout_width="fill_parent" android:layout_height="0.0px" android:layout_weight="1.0">
    <com.rockrobo.ui.RRNavigateStick android:id="@id/navigate_stick" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" />
    <TextView android:id="@id/rc_starting" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10.0dip" android:text="@string/rc_starting_up" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" />
</RelativeLayout>
<LinearLayout android:layout_gravity="center" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/rc_bot_margin">
    <CheckedTextView android:textColor="@color/rc_button_text_color" android:gravity="center" android:id="@id/spot_clean" android:background="@drawable/rc_button_bg" android:clickable="true" android:layout_width="@dimen/rc_button_width" android:layout_height="@dimen/rc_button_height" android:layout_marginRight="@dimen/rc_bot_bar_gap" android:text="@string/rr_spot" />
    <CheckedTextView android:textColor="@color/rc_button_text_color" android:gravity="center" android:id="@id/clean" android:background="@drawable/rc_button_bg" android:clickable="true" android:layout_width="@dimen/rc_button_width" android:layout_height="@dimen/rc_button_height" android:layout_marginRight="@dimen/rc_bot_bar_gap" android:text="@string/rr_clean" />
    <CheckedTextView android:textColor="@color/rc_button_text_color" android:gravity="center" android:id="@id/charge" android:background="@drawable/rc_button_bg" android:clickable="true" android:layout_width="@dimen/rc_button_width" android:layout_height="@dimen/rc_button_height" android:text="@string/rr_charge" />
</LinearLayout>


有人能帮忙吗?谢谢。

嗨,请尝试更改线性布局宽度,以匹配父级和垂直方向


请试着写这样的回答作为评论。你能附上截图吗