android - Android 从右到左语言支持
问题描述
我正在开发一个应用程序,并且不想支持 RTL 。这是我的问题:如何在不让整个应用程序支持 RTL 的情况下让我的偏好屏幕支持 RTL?
谢谢您的回答。
解决方案
如果您的 minSdkVersion 是 Android 4.2(API 级别 17),您可以使用:`
android:layoutDirection="rtl"
https://developer.android.com/reference/android/util/LayoutDirection
否则:
ViewCompat.setLayoutDirection(findViewById(R.id.view), ViewCompat.LAYOUT_DIRECTION_RTL);
推荐阅读
- java - 从递归解决方案构建最大子阵列动态规划解决方案
- php - 无重复数字的 PHP 随机数
- vue.js - 使用 Gridsome 修改 Vue.js 项目中的路由器元字段
- javascript - 需要一个动态的 Tooltip,它将指示 React 中 Canvas 彩色区域的百分比
- android - 密钥库和私钥迁移
- html - 使用ngmodel始终显示2位小数的角度输入标签并在接收输入时限制2位小数?
- android - 当我使用媒体播放器和搜索栏时,如何跟踪帧序列?
- kdb - KDB/q:如何更新包含不同列的行的表?
- if-statement - 如何从数组中获取平均股价?
- r - 我有一些关于在闪亮的 r 中通过 DTedit 包编辑 DataTable 的问题