一个demo掌握Android Manifest文件的android:supportsRtl="true"属性(7.22)

本文详细介绍了AndroidManifest中android:supportsRtl属性的作用,该属性用于声明应用是否支持从右到左的布局,适用于右到左阅读习惯的用户。当设置为true且targetSdkVersion为17或更高时,系统将激活RTL相关API,使应用能显示RTL布局。默认值为false。开启该属性后,应用布局会根据用户Locale选择的方向调整。
摘要由CSDN通过智能技术生成

supportsRtl ==>  supports right to lift  

是否支持 从右到左的布局(主要是方便从右到左的阅读习惯)

官网注解 :

Declares whether your application is willing to support right-to-left (RTL) layouts.

If set to true and targetSdkVersion is set to 17 or higher, various RTL APIs will be activated and used by the system so your app can display RTL layouts. If set to false or if targetSdkVersion is set to 16 or lower, the RTL APIs will be ignored or will have no effect and your app will behave the same regardless of the layout direction associated to the user's Locale choice (your layouts will always be left-to-right).

The default value of this attribute is false.

This attribute was added in API level 17.



开发者选项中的开关如下 :




布局代码如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.ufotosoft.demo.MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="LinearLayout" />
    <LinearLayout
        android:layout_width="match_parent"
        android:lay
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值