设置边界没有正确调整大小

时间:2015-05-28 03:24:22

标签: android android-custom-view setbounds

我创建了一个自定义视图,并将背景设置为XML可绘制的形状。目标是当用户点击视图时它的大小增加,但是setBounds(0, 0, width * 2, height * 2)增加了大小,但是切断了一些新视图并保持相同的大小。我已尝试使用fill parent,并使用特定的宽度和高度,但它不起作用。

<package.ItemView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_row="0"
    android:layout_column="0"
    android:layout_margin="0dp"
    android:background="@drawable/rounded_rect"
    android:layout_marginBottom="30dp"
    custom:text="yes"
    custom:sound="yes"
    custom:imagePath="@drawable/yes"
    custom:backgroundColor="#a0d80e"
    />

0 个答案:

没有答案