首页 > 解决方案 > Android RTL support for shapes corners radius

问题描述

I notice that there is no bottomEndRadius in shapes but instead just bottomRightRadius

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="@color/colorPrimary" />
    <corners android:bottomRightRadius="5dp" />

</shape>

Is there any work around this to support right-to-left layouts?

标签: androidright-to-leftshapes

解决方案


我发现的唯一方法是为 RTL 资源使用单独的目录。例如,drawable-ldrtl/ 用于图形或 layout-ldrtl/ 用于布局。

查看此文档了解更多详细信息:https ://developer.android.com/training/basics/supporting-devices/languages#MirroringAddResources


推荐阅读