安卓的LinearLayout - 不垂直或水平的规定 [英] Android: LinearLayout - not vertical or horizontal specified
本文介绍了安卓的LinearLayout - 不垂直或水平的规定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是跟随教程,我注意到,有是没有指定的垂直水平也没有一个的LinearLayout。我在另一个教程,它基本上需要告诉...这是什么意思有没有?它是坏?这是由另一个LinearLayout中这并封闭
<?XML版本=1.0编码=UTF-8&GT?;
< LinearLayout中的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:方向=垂直> <的LinearLayout
机器人:ID =@ + ID /组
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT> <按钮
机器人:ID =@ + ID /加
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文字=新增
安卓的onClick =的onClick/> <按钮
机器人:ID =@ + ID /删除
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文字=删除第一
安卓的onClick =的onClick/> < / LinearLayout中> < ListView控件
机器人:ID =@机器人:ID /列表
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:文字=@字符串/你好/> < / LinearLayout中>
解决方案
这只是意味着定位
默认为横向
。因此,如果该属性是不存在的,线性布局是一个的横向的线性布局。
I was following a tutorial and i noticed that there was a linearlayout that was not specified vertical nor horizontal. I was told in another tutorial that it was basically required... what does it mean to have neither? is it bad? this was enclosed by another linearlayout which DID
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/group"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add New"
android:onClick="onClick"/>
<Button
android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Delete First"
android:onClick="onClick"/>
</LinearLayout>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>
解决方案
It just means that orientation
defaults to horizontal
. So if the attribute is not there, the linear layout is a horizontal linear layout.
这篇关于安卓的LinearLayout - 不垂直或水平的规定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文