【发布时间】:2014-03-11 17:52:26
【问题描述】:
我无法正确地将我的 LinearLayout 设置为“match_parent”。正如您在屏幕截图中看到的那样,底部的空白不应该是。如果我尝试将此背景颜色直接应用于样式,我会得到一个奇怪的结果,即卡片本身的每个视图都填充有背景颜色。 在我实现 FadingActionBar 之前它就起作用了:
我的布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/AppBaseThemeCardBG"
android:padding="@dimen/activity_standard_padding"
android:orientation="vertical">
<LinearLayout
android:id="@+id/eventCard"
style="@style/nowCardStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.mikebdev.douala.widget.RobotoTextView
android:id="@+id/eventDate"
android:textColor="@color/gray"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:typeface="roboto_condensed_light"
android:textSize="@dimen/textSizeNormal" />
<com.mikebdev.douala.widget.RobotoTextView
android:id="@+id/eventHead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
app:typeface="roboto_condensed_light"
android:textSize="@dimen/textSizeVeryLarge" />
<com.mikebdev.douala.widget.RobotoTextView
android:id="@+id/eventBody"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:typeface="roboto_condensed_light" />
</LinearLayout>
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
【问题讨论】:
标签: android xml android-layout