gpt4 book ai didi

android - Buttonstyle - 尺寸类型不允许

转载 作者:行者123 更新时间:2023-11-29 17:21:36 24 4
gpt4 key购买 nike

我设计了一个按钮,如下所示,但是收到了一些错误消息。

    android:background="@drawable/buttonshape"
android:shadowColor="#A8A8A8"
android:shadowDx="0dp"
android:shadowDy="0dp"
android:shadowRadius="5dp"

Dimension types not allowed (at 'shadowDy' with value '0dp'). Dimension types not allowed (at 'shadowRadius' with value '5dp'). Dimension types not allowed (at 'shadowDx' with value '0dp').

buttonshape.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<corners
android:radius="14dp"
/>
<gradient
android:angle="45"
android:centerX="35%"
android:centerColor="#198CFF"
android:startColor="#449DEF"
android:endColor="#2F6699"
android:type="linear"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<stroke
android:width="1dp"
android:color="#878787"
/>
</shape>

最佳答案

只是不要使用单位,例如:

   android:shadowDx="2"
android:shadowDy="2"
android:shadowRadius="5"
android:shadowColor="#A8A8A8"

关于android - Buttonstyle - 尺寸类型不允许,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36351939/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com