不支持Path.isConvex. Android Studio-切换按钮 [英] Path.isConvex is not supported. Android Studio - Toggle Button

查看:127
本文介绍了不支持Path.isConvex. Android Studio-切换按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在stackoverflow上阅读了有关此问题的信息,但不幸的是没有找到正确的答案.

I already read about this issue on stackoverflow but unfortunately haven't found the correct answer.

我使用了ToggleButton,它在渲染窗口中向我显示了以下错误:

I use a ToggleButton and it shows me the following error in the rendering window:

The graphics preview in the layout editor may not be accurate: 
- Different corner sizes are not supported in Path.addRoundRect. (Ignore for this session) 
- Path.isConvex is not supported. (Ignore for this session)

终端显示以下错误消息:

The terminal shows the following error message:

E/dalvikvm: Could not find class 'android.widget.ThemedSpinnerAdapter', referenced from method android.support.v7.widget.AppCompatSpinner$DropDownAdapter.<init>

当我在渲染"窗口中将api级别设置为19而不是23时,渲染问题"窗口将不会出现,但在具有Android 4.4.2.的设备上运行时,应用中仍然会出现错误.

When I set the api level in the rendering window to 19 instead of 23 the "Rendering problem" window won't appear but the error still occurs in the app when running on a device with Android 4.4.2.

这是我简单的ToggleButton:

This is my simple ToggleButton:

<ToggleButton
                android:id="@+id/editToggleKunde6"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textOn="@string/kunde_bearbeiten_txt1"
                android:textOff="@string/kunde_bearbeiten_txt2"
                android:checked="true"
                />

感谢任何想法!

推荐答案

Path.isConvex可以通过仅使用单个标记(而不是每个角)来删除半径... 所以不要使用

Path.isConvex can be removed by using only a single tag for radius than for each corner... so instead of using

<corners 
    android:bottomLeftRadius="10dp"
    android:bottomRightRadius="10dp"
    android:topLeftRadius="10dp"
    android:topRightRadius="10dp"/>

放入

<corners android:radius="10dp"/>

<corners android:radius="10dp"/>

另外,可以使用以下代码实现选择性的圆角

Also, Selective round corners can be achieved using the following code

<corners android:radius="10dp" android:bottomLeftRadius="0dp" android:topRightRadius="0dp"/>

编辑(简便方法)

为了修复它,您也可以将其设置为src,而不是background设置为 android:src="@drawable/your_drawable_name"

<corners android:radius="10dp" android:bottomLeftRadius="0dp" android:topRightRadius="0dp"/>

Edit (easy way)

In order to fix it, you can also set it as src instead of background as android:src="@drawable/your_drawable_name"

没问题,它工作正常.刚才由我测试过.

No problem, It works fine. Tested by me just now.

这篇关于不支持Path.isConvex. Android Studio-切换按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆