如何在Android中将两个按钮放在同一行

如何在我的 Android应用程序的登录布局中将两个按钮放在同一行?

解决方法

只需做一个线性的布局.将方向设置为水平,并添加两个按钮.它准备好你会得到你想要的.在发布这样的问题之前,尝试谷歌搜索,你会得到答案肯定.这段代码将帮助你.
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button" />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button" />

</LinearLayout>

如果您想要将layout.give中的两个按钮设为两个按钮的重量.

相关文章

Android 如何解决dialog弹出时无法捕捉Activity的back事件 在...
Android实现自定义带文字和图片的Button 在Android开发中经常...
Android 关于长按back键退出应用程序的实现最近在做一个Andr...
android自带的时间选择器只能精确到分,但是对于某些应用要求...