今天我们用配置文件实现线性布局管理器的使用。
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:context=".MainActivity">
<TextView
android:id="@+id/mytext1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="安卓开发 "/>
<TextView
android:id="@+id/mytext2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="线性布局管理器" />
1,找到res下边的layout下边的xml文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
</LinearLayout>
本文介绍如何通过XML配置文件设置线性布局管理器。主要内容包括定位到res/layout下的XML文件,并详细展示了如何定义水平方向的线性布局及内部包含的TextView组件。

1641

被折叠的 条评论
为什么被折叠?



