【发布时间】:2013-06-07 21:54:46
【问题描述】:
我正在开发一个 Android 应用程序,我想在 Eclipse 中设计一个大于屏幕高度的布局。
我有一个片段的布局,这个片段将在FragmentActivity 上的ScrollView 内。
这是我的片段布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/user_pro_main_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/text_state"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/layout_state"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
我是否必须更改 android:layout_height="match_parent" 以使其在 eclipse 的设计器中更大?
如果我想在 Eclipse Designer 上看到更大的布局,我该怎么做?
【问题讨论】:
-
使用 android:layout_height="wrap_content" 你的布局高度将匹配你的内容高度而不是屏幕,当然它应该是顶级布局