2
我经历了一些尴尬的行为。下面的LinearLayout被分配了正确的背景,但是所有的角落半径都被简单地解散了。问题是为什么,以及我如何解决这个问题?如果我在TextView
上设置android:background
,它工作正常。不要加权LinearLayouts支持round-rect背景吗?
为什么我将TextView放在LinearLayout中呢?我想动画TextView的文本。只有文字,而不是背景。所以我将它包装到LinearLayout中。
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/summary_title_horizontal_last" >
<TextView
android:id="@+id/evaluation_highscore_title"
style="@style/Summary.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/evaluation_highscore"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
</LinearLayout>
@绘制/ summary_title_horizontal_last:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="@color/summary_title_start"
android:endColor="@color/summary_title_end"
android:angle="270" />
<corners android:bottomLeftRadius="@dimen/summary_box_radius" />
</shape>
太愚蠢了。是的,电视的风格设置相同的背景,但*没有*任何圆角。简单的透支。 – poitroae 2013-02-18 15:22:30