Android Studio中有多个根标签

Android Studio中有多个根标签,第1张

Android Studio中有多个根标签

由于在Android中,每个xml文件都必须只有一个根布局。 只需在LinearLayout中添加EditText和Button。正确的代码如下所示

<LinearLayout    xmlns:android="http://schemas.android.com/apk/res/android"    android:orientation="horizontal"    android:layout_width="match_parent"    android:layout_height="match_parent">    <EditText          android:id="@+id/edit_message"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:hint="@string/edit_message" />    <Button android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/button_send" /></LinearLayout>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5615551.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存