所以我的问题是,当我在装有 droid 2.3 的设备上启动我的项目时,布局边距不起作用。但在 4.0.3 及更高版本上它可以工作。我不明白我在哪里犯了错误,我有 2 个相同的设备(华为荣誉)但操作系统(GingerBread 和 ICS)不同,我真的不明白为什么我的布局边距不能在我的 gingerBread 设备上工作。所以这里是屏幕截图:
XML
<?xml version="1.0" encoding="utf-8"?>
<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/flipper"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/app_background" >
<include
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/layout_pleasewait" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:orientation="vertical" >
<View
android:id="@+id/divider1"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_marginTop="@dimen/divider_margin"
android:background="@color/layout_divider_bold" />
<ExpandableListView
android:id="@+id/firmsList"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:cacheColorHint="#00000000"
android:divider="@color/layout_divider"
android:dividerHeight="1dp"
android:groupIndicator="@null" >
</ExpandableListView>
</LinearLayout>
<include
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/layout_no_internet" />
<include
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/layout_no_searchresult" />
</ViewFlipper>
最佳答案
您可能想尝试填充,类似的效果。如果不行,可以考虑多放一个固定长度的 View 。这可能不是一个好的解决方案,但它应该有效。希望对您有所帮助。
关于android - 布局边距不适用于 android 2.3.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19476626/