right-to-left 相关问题

从右到左(RTL)是指从右到左而不是从左到右书写和阅读的自然语言的脚本,如希伯来语,阿拉伯语和波斯语。对于从右到左和从左到右文本的交互问题,更喜欢“bidi”标签。

android ConstraintLayout Flow:从右到左对齐项目

我正在使用 android ConstraintLayout Flow ,我必须从右到左排列项目,如下所示: XML代码: 我正在使用 android ConstraintLayout Flow ,我必须从右到左排列项目,如下所示: XML代码: <androidx.constraintlayout.helper.widget.Flow android:id="@+id/flow" android:layout_width="0dp" android:layout_height="wrap_content" app:flow_horizontalStyle="spread_inside" app:flow_maxElementsWrap="4" app:flow_verticalGap="29dp" app:flow_wrapMode="aligned" app:constraint_referenced_ids="item1 , item2 , ..." app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@id/headerTextView" /> 注意:我们的supportsRtl在清单中设置为False ... 我该怎么做?! 有一种解决方法,可以通过使用 ConstraintLayout 在 Y 方向上旋转 android:rotationY="180" 来从右向左将项目添加到流程中 这将反转整个布局,包括流程中的每个单独元素;因此,在下面的演示中,您也会看到相反的文本: 为了解决这个问题,我们必须对每个单独的元素进行相反的操作。这需要一个 ViewGroup,因此这里每个单独的元素都被包装在 FrameLayout 中以达到此目的。 演示: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content" android:rotationY="180"> <androidx.constraintlayout.helper.widget.Flow android:id="@+id/flow" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" app:constraint_referenced_ids="button1, button2, button3, button4, button5, button6, button7, button8, button9" app:flow_horizontalGap="8dp" app:flow_maxElementsWrap="3" app:flow_verticalBias="1" app:flow_verticalGap="8dp" app:flow_verticalStyle="packed" app:flow_wrapMode="chain" tools:ignore="MissingConstraints" /> <FrameLayout android:id="@+id/button1" android:layout_width="0dp" android:layout_height="wrap_content" android:rotationY="180" tools:ignore="MissingConstraints"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light" android:text="1" android:textSize="18sp" /> </FrameLayout> <FrameLayout android:id="@+id/button2" android:layout_width="0dp" android:layout_height="wrap_content" android:rotationY="180" tools:ignore="MissingConstraints"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light" android:text="2" android:textSize="18sp" /> </FrameLayout> <FrameLayout android:id="@+id/button3" android:layout_width="0dp" android:layout_height="wrap_content" android:rotationY="180" tools:ignore="MissingConstraints"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light" android:text="3" android:textSize="18sp" /> </FrameLayout> <FrameLayout android:id="@+id/button4" android:layout_width="0dp" android:layout_height="wrap_content" android:rotationY="180" tools:ignore="MissingConstraints"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light" android:text="4" android:textSize="18sp" /> </FrameLayout> <FrameLayout android:id="@+id/button5" android:layout_width="0dp" android:layout_height="wrap_content" android:rotationY="180" tools:ignore="MissingConstraints"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light" android:text="5" android:textSize="18sp" /> </FrameLayout> <FrameLayout android:id="@+id/button6" android:layout_width="0dp" android:layout_height="wrap_content" android:rotationY="180" tools:ignore="MissingConstraints"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light" android:text="6" android:textSize="18sp" /> </FrameLayout> <FrameLayout android:id="@+id/button7" android:layout_width="0dp" android:layout_height="wrap_content" android:rotationY="180" tools:ignore="MissingConstraints"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light" android:text="7" android:textSize="18sp" /> </FrameLayout> <FrameLayout android:id="@+id/button8" android:layout_width="0dp" android:layout_height="wrap_content" android:rotationY="180" tools:ignore="MissingConstraints"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light" android:text="8" android:textSize="18sp" /> </FrameLayout> <FrameLayout android:id="@+id/button9" android:layout_width="0dp" android:layout_height="wrap_content" android:rotationY="180" tools:ignore="MissingConstraints"> <Button android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light" android:text="9" android:textSize="18sp" /> </FrameLayout> </androidx.constraintlayout.widget.ConstraintLayout> 我找到并且有效的解决方案是在父级(我们的 ConstraintLayout)上设置 RotationY=180f,然后在 ConstraintLayout 中的每个项目上设置 RotationY=180f。 app:flow_horizontalBias="1" 在缺陷布局中使用它 我正在使用流程布局并让它可以使用: 应用程序:flRtl =“true”>

回答 4 投票 0

以 RTL 语言翻转菜单内容

在project.pbxproj中,我将developmentRegion更改为ar,以在整个应用程序中强制使用阿拉伯语和RTL布局。除了本例中的菜单视图内容之外,一切看起来都不错: 导入 SwiftUI 结构

回答 4 投票 0

从右到左开始表格单元格

我正在编写一个希伯来语网页,我需要创建一个表单,问题是我需要单元格从右到左开始,而不是默认从左到右开始,所以当我按下选项卡按钮时,我。 ..

回答 3 投票 0

在 RTL 语言中颤动可选择文本锚点位置

在flutter中,当我尝试使用rtl语言的SelectableText小部件时,锚点行为错误。 实在是难以预料。你抓住其中一个锚,但另一个移动了...... 我在两者上都测试过这个...

回答 1 投票 0

如何检测当前网页或元素方向(rtl/ltr)或javascript中的任何其他属性?

我如何读取当前影响不一定是样式的元素的任何属性?其中一个属性是“dir”。

回答 3 投票 0

未镜像 RTL 语言的视图

我正在尝试将我的 SwiftUI 应用程序本地化为 RTL 语言,但无法镜像视图(导航演示方向、链接 V 形方向、工具栏项目位置等)我

回答 1 投票 0

SwiftUI 视图未镜像为 RTL 语言

我正在尝试将我的 SwiftUI 应用程序本地化为 RTL 语言,但无法镜像视图(导航演示方向、链接 V 形方向、工具栏项目位置等)我

回答 1 投票 0

颤动中的从右到左 (RTL)

我使用 Flutter 已经超过一周了,想要创建一个阿拉伯语(从右到左)应用程序。 我正在阅读Internationalizing Flutter Apps,但它没有提到如何设置布局方向。 所以,...

回答 7 投票 0

声明包含希伯来字符的翻译数组后,str_replace() 不会按预期替换子字符串

我有一个包含希伯来语单词的数组,我需要在字符串中找到并替换它。翻译数组被定义为键值对。 在英语中,这有效。 函数replace_twophrase_words($stri...

回答 2 投票 0

从右到左打印表格单元格

我制作了一个表格,并希望第一个单元格从右侧开始,而不是默认从左侧开始。 我尝试更改 CSS 中的 float 属性,但似乎没有帮助。 这是代码: 我制作了一个表格,并希望第一个单元格从右侧开始,而不是默认从左侧开始。 我尝试更改 CSS 中的 float 属性,但似乎没有帮助。 这是代码: <table border="0" width="100%" cellspacing="0" align="center" class="result_table"> <tr align="right"> <th bgcolor="#cccccc" align="right">1</th> <th bgcolor="#cccccc" size="17">2</th> <th bgcolor="#cccccc">3</th> <th bgcolor="#cccccc">4</th> </tr> </table> <style> table.result_table { float:right; } </style> 任何人都可以建议一种方法来改变这张桌子的浮动吗? 正如评论中所建议的,您可以将方向性设置为从右到左(RTL)。但是,除非您的表格内容采用从右到左的语言,否则您还应该将表格内容元素中的方向性设置为从左到右。否则,它们继承 RTL 方向性,这在许多情况下会引起意外,因为方向性还设置整体文本方向性。这不会影响西方语言的正常文本,但会影响例如像“4 (5)”这样的内容,在 RTL 方向性下会显示为“(5) 4”。 因此,您应该设置 table.result_table { direction: rtl; } table.result_table caption, table.result_table th, table.result_table td { direction: ltr; } 有一种更简单的方法。您可以将 dir="rtl" 添加到表格中。 <table dir="rtl"> ... </table> 或者您可以使用 CSS 而不是使用 HTML 属性: <table style="direction:rtl"> ... </table> 我不确定这是否可以仅使用 CSS 来实现。如果使用 jQuery 适合您,这里有一个起始想法,可能会让您获得所需的结果: CSS: .result_table{float:left; width:100%; border-collapse:collapse; padding:0;} .result_table th{float:right; padding:0;} JS: var cols = $('.result_table th').length; var colWidth = 100 / cols; $('.result_table th').css({width:colWidth+'%'}) 示例 - jsFiddle

回答 3 投票 0

我如何在Chartjs中实现Yaxis的RTL

目前我正在开发一个网站,我必须在标签和工具提示上对齐文本 RTL,因为它是阿拉伯语。 我已阅读文档并进行了大量搜索,但无法理解为什么 RTL 不起作用

回答 2 投票 0

从右到左的文本(如希伯来语)

在c#上。 Winforms。每当我尝试在希伯来语\阿拉伯语的文本框中写括号时,它们都会被颠倒 和 位于文本的另一侧(它们应该位于左侧的右侧)。 我试过这些...

回答 1 投票 0

Compose 多平台 - 将应用程序语言更改为 RTL 语言时,iOS 应用程序布局不适应 RTL

我正在开发一个 Kotlin Compose 多平台应用程序,支持多种语言,包括 LTR 和 RTL 语言。当用户将应用程序语言更改为从右到左的希伯来语时,...

回答 1 投票 0

DataTable PDF 导出中的 RTL

下面的内容很好,但是对于包含阿拉伯语长文本的列,第一行变成了第二行,第二行变成了第一行: $('#table').dataTable({ 纽扣: [ ...

回答 1 投票 0

Wordpress RTL,将RTL添加到主题

我有一个 WordPress 主题,其中包含多个 css 文件 样式.css 资产/main.css 资产/pager.css 资产/blog.css 我希望我的网站包含阿拉伯语和英语两种语言(LT...

回答 3 投票 0

R 中从右到左的语言支持,使用 Mac

我想知道在使用Mac时是否有办法支持R中从右到左的语言 例如假设以下代码: x <- data.frame(a=runif(10),b=runif(10)) ggplot(x, aes(a,b)) +

回答 4 投票 0

如何在Markdown中写RTL方向

如何在Markdown文件中编写RTL方向? 例如: #约南 * 关于 * 关于 * 约南

回答 2 投票 0

Markdown 中的 RTL

是否有任何现有的 Markdown 插件规范包含对 RTL 语言的支持? 我希望是这样的 这一段从左到右 <- This paragraph is right to le...

回答 11 投票 0

用 Rust 书写希伯来语文本

我正在用 Rust 制作一个 CLI 应用程序,该应用程序包含多种语言。其中一种语言是希伯来语,它是一种 RTL 语言。当用希伯来语写作时,例如: println!("קוד לדוגמא&quo...

回答 1 投票 0

Flutter web rtl语言+html渲染器的括号问题

当将包含括号 () 符号(或 <> 符号)的 RTL 语言(波斯语)文本放置在文本小部件中并且我们使用 html 渲染器构建 Web 时,问题就会出现(flutter run...

回答 0 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.