我目前正试图创建一个嵌入ScrollView的RelativeLayout(因此RelativeLlayout的内容可以垂直滚动)。我的布局文件看起来是这样的:Android:滚动视图中的RelativeLayout全部堆积在现场
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/label_first_day_of_budget_cycle"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="10dp"
android:text="@string/first_day_of_budget_cycle"
android:textSize="20sp" />
<include
android:id="@+id/settings_divider_one"
android:layout_alignParentLeft="true"
android:layout_below="@id/label_first_day_of_budget_cycle"
layout="@layout/w_divider" />
<TextView
android:id="@+id/label_monthly_income"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_below="@id/settings_divider_one"
android:layout_margin="10dp"
android:text="@string/monthly_income"
android:textSize="20sp" />
<include
android:id="@+id/settings_add_income"
android:layout_alignParentLeft="true"
android:layout_below="@id/label_monthly_income"
layout="@layout/w_add" />
<include
android:id="@+id/settings_divider_two"
android:layout_alignParentLeft="true"
android:layout_below="@id/settings_add_income"
layout="@layout/w_divider" />
<TextView
android:id="@+id/label_monthly_expenses"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_below="@id/settings_divider_two"
android:layout_margin="10dp"
android:text="@string/monthly_expenses"
android:textSize="20sp" />
<include
android:id="@+id/settings_add_expenses"
android:layout_alignParentLeft="true"
android:layout_below="@id/label_monthly_expenses"
layout="@layout/w_add" />
<include
android:layout_alignParentLeft="true"
android:layout_below="@id/settings_add_expenses"
layout="@layout/w_divider" />
</RelativeLayout>
</ScrollView>
,这是它的外观我的电话:
我想尽一切可能的变化我能想到的/发现在网络上或计算器,迄今为止没有成功。我不知道我还能尝试什么,或者我在这里失去了什么。
我尝试改变RelativeLayout和Scrollview的layout_width和layout_height的值,但没有成功。任何暗示我做错了什么将不胜感激。
UPDATE
继Ben的建议,我删除了包括再布局呈现正常。我提交了一个错误报告click因为我的意见是,包括应该与嵌入到Scrollviews中的RelativeLayouts一起工作。至少我没有看到他们不应该这样做的理由。如果我的布局包含另一个错误,以防止包括工作正常,我想/我希望我会在票据中相应地回复 。
我尝试了你的建议,并解决了这个问题:哦!但从技术上讲,这意味着,他们的包含功能无法正常工作?你知道是否有任何机会有相关的错误报告?我真的不想复制粘贴所有这些包括-_-,但无论哪种方式解决神秘的:) - 非常感谢! – AgentKnopf
不幸的是,我不能告诉你任何关于这个问题的更多信息,但是如果你发现了这个问题的解决方案,请告诉我;) – ben
确定的事情:) - 我只希望有人足够仁慈地检查我提交的xD错误报告 – AgentKnopf