Android UI 开发:从基础布局到精确约束布局
1. 向 UI 添加多行文本视图
首先,切换到设计(Design)选项卡,在组件面板的文本(Text)类别中找到多行文本(Multiline Text),将其拖到之前添加的文本视图(TextView)下方。使用你习惯的搜索方法,将文本设置为“Select a layout type to view an example. The onClick attribute of each button will call a method which executes setContentView to load the new layout”。
此时,线性布局(LinearLayout)的 XML 会更新,新增一个子元素,代码如下:
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine"
android:text="Select a layout type to view an example.
The onClick attribute of each button will call a method
which executes setContentView to load the new layout" />
超级会员免费看
订阅专栏 解锁全文
15

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



