【问题标题】:Android Shape does not work on LG devicesAndroid Shape 不适用于 LG 设备
【发布时间】:2014-07-21 22:19:39
【问题描述】:

我有这个可绘制的 xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:bottomRightRadius="5dp"
        android:bottomLeftRadius="5dp" android:topLeftRadius="5dp"
        android:topRightRadius="5dp" />
    <solid android:color="#000000" />
   <stroke android:width="1dip" android:color="#ffffff"/>
    <gradient android:startColor="#00000000" android:endColor="#00000000"
        android:angle="270" />      
</shape>

我把这个drawable放在LinearLayout上

        <LinearLayout android:id="@+id/llTime"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:background="@drawable/back_rounded"
            android:paddingLeft="5dp"
            android:paddingRight="2dp">

一切正常。除了在一些运行其库存 ROM 的 LG 设备上。形状应该是透明的,但在 LG 上,形状是用白色块填充的。

怎么了?什么是替代解决方案?

谢谢

【问题讨论】:

  • 您好,您找到解决方法了吗?我也有这个问题,但是一切都有很大的背景!

标签: android


【解决方案1】:

尝试设置&lt;solid&gt; from:

<solid android:color="#000000" />

到:

<solid android:color="#00000000" />

(在纯色上设置 alpha 值)

在 LG Optimus LTE 2 上测试。

【讨论】:

    猜你喜欢
    • 2017-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-11
    • 2016-07-05
    • 2019-02-25
    相关资源
    最近更新 更多