CardView背景Alpha颜色无法正常工作

时间:2018-07-29 07:13:07

标签: android android-layout android-cardview android-shape

我正在尝试使gcc -Isrc -c src/firstsource.c -o obj/firstsource.o带有高程,但是问题是当我使用像CardView这样的非alpha颜色时,它可以正常工作,但是当我设置像"#ffffff"这样的alpha颜色时,它会显示另一个内部视图 像这样

enter image description here

但是当我设置#b0ffffff之类的非字母颜色时,它会很好

enter image description here

这是我的布局

"#ffffff"

顺便说一句,我正在尝试这样的观点

enter image description here

3 个答案:

答案 0 :(得分:0)

只需删除行:

card_view:cardBackgroundColor="#b0ffffff"

它应该可以工作

答案 1 :(得分:0)

尝试一下

Timer

答案 2 :(得分:0)

如果您看到CardView周围有令人讨厌的边框,可以尝试以下代码,如배준모's answer中所述。 androidx.cardview.widget.CardView也应如此。

<android.support.v7.widget.CardView
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:layout_margin="@dimen/margin"
    android:background="@android:color/transparent"
    android:elevation="0dp"
    app:cardBackgroundColor="@color/form_card_bg_color"
    app:cardElevation="0dp"
    app:contentPadding="@dimen/margin_large"
    app:cardPreventCornerOverlap="false"
    app:cardUseCompatPadding="true" >
相关问题