读书人

android分布有关问题

发布时间: 2013-04-09 16:45:09 作者: rapoo

android分布问题
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello_world" />

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone"/>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button" />

</LinearLayout>


各位大侠,第一排出现红叉,解释如下:
Wrong orientation? No orientation specified, and the default is horizontal, yet this layout has multiple children where at
least one has layout_width="match_parent"
[解决办法]
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"

读书人网 >Eclipse开发

热点推荐