- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
目前我已经使用以下 XAML 构建了一个 ListView
<ListView x:Name="_lstMenu" VerticalOptions="FillAndExpand" BackgroundColor="Transparent">
<ListView.ItemTemplate>
<DataTemplate>
<ImageCell Text="{Binding Title}" ImageSource="{Binding IconSource}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
我想做的是,当语言切换为阿拉伯语时,整个用户体验都是从右到左的。为此,我使用了 RotateYTo(180) 方法。
protected override void rotateElementsY(int rotationY)
{
base.rotateElementsY(rotationY);
foreach (View sub in subviews())
{
sub.RotateYTo(rotationY);
}
}
private View[] subviews()
{
View[] _subs = new View[] {
imgUser, lblGreetings, lblUserName, lstMenu, stkBottom};
return _subs;
}
到目前为止它运行良好,除了 ImageCell,因为我只能在从左到右的方向上显示它,并且无法旋转 Cell 的任何子项(标签、图像)。
PS:我也试过镜像 ListView 后把单元格的阿拉伯文字倒写,但还是不合适。
最佳答案
感谢 ganchito55 启发我找到我需要的答案。我几乎使用了他制作 RTL 的想法,但也有能力在需要时更改为 LTR。
<ListView x:Name="_lstMenu" VerticalOptions="FillAndExpand" BackgroundColor="Transparent">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding IconSource}" IsVisible="{Binding isEnglish}"/>
<Label Grid.Column="1" Text="{Binding Title}" VerticalTextAlignment="Center" HorizontalTextAlignment="{Binding alignment}"/>
<Image Grid.Column="2" Source="{Binding IconSource}" IsVisible="{Binding isArabic}"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
如您所见,我已将另一个图像添加到项目模板,并向列出的项目对象添加属性,以决定每次显示哪个图像和对齐方式。
关于c# - Xamarin 形成细胞操作 RTL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44870667/
iOS 应用程序,我们要显示来自服务器的新闻。使用UIlabel 当他只用一种语言而不考虑布局时,一切都是完美的(我们正在将布局 RTL 切换为 LTR,以适应不同的语言,包括阿拉伯语、希伯来语) 当
新版本的 React Native 已经发布了对 RTL 设备的支持: https://facebook.github.io/react-native/blog/2016/08/19/right-to
我将 Material UI 5 与 next.js 一起使用,并使用 emotion 和 stylis-plugin-rtl v2 实现了与此处文档完全相同的每个步骤: https://next.m
我知道如何在方向为内联时设置样式 foo div[dir="rtl"] { ....; } 但是如何设置样式 foo ? 两者的行为都符合预期(文本的右“对齐”),但我需要对内部的某些元素进行更精细
这个问题在这里已经有了答案: What is use of android:supportsRtl="true" in AndroidManifest xml file (4 个回答) 关闭4年前。
我正在使用material-ui和next和jss-rtl在我的react项目但是有一个问题页面仍然是ltr使用后 -rtl组件代码: import React from "react"; impor
我敢发誓,vivado 有一个错误,它永远不会刷新对 RTL 文件、verilog 或 vhdl 所做的任何接口(interface)更改,在使用“添加模块”将其粘贴到“ block 设计”后....
我正在尝试将 react Material 模板添加到我的 reactJs 项目中。我修复了所有错误,但我无法修复这个错误 WARNING in ./node_modules/stylis-plugi
我在 android 中构建一个绘图应用程序,我在绘制矩形时注意到一个问题。应该根据语法绘制矩形 new Rect(left, top, right, bottom) 现在我的逻辑通过取起点 (sta
我将 Tinymce 编辑器安装到我的网站。现在我需要将默认方向设置为 RTL 而不是 LTR。您可以在下面看到-- tinymce.init({ selector: 'textar
我注意到没有 bottomEndRadius在形状中,而只是 bottomRightRadius 是否有任何解决方法来支持从右到左的布局? 最佳答案 我发现的唯一方法是为 R
我使用此代码来运行具有 RTL 支持的 Isotope $.Isotope.prototype._positionAbs = function( x, y ) { return { right:
尝试显示以数字开头的希伯来语字符串,总是在字符串末尾显示数字,如下所示:1. йום שйשй בבוקר 但我需要在文本右侧显示数字- 有什么解决办法吗? 它发生在 UILabel & UIText
我在 react-native 中创建了一个应用程序,当电话语言为 En 时一切正常,但是当我更改电话语言时,UI 崩溃并且一切都向后 我在用 "react": "16.6.3", "reac
WordPress 非常强大......但对于阿拉伯语和希伯来语等 RTL 语言却很弱......我需要让前端使用阿拉伯语,而管理区域则需要使用英语,当然还有 LTR。如果我使用阿拉伯语版本的Word
我想知道为什么将Camera2 API与RTL语言一起使用时,摄像机预览会有所不同。具体来说,我有两个问题: 使用RTL时,相机上是否有任何特定设置? 我正在通过OpenCV使用边缘检测。 OpenC
我正在尝试在阿拉伯语 RTL 页面中使用 jQuery 菜单。我可以将其设为 RTL,但图标应该是 ui-icon-carat-1-w 而不是 ui-icon-carat-1-e。我创建了jsfidd
我正在尝试在统一输入字段中编写波斯语。波斯语是从右到左的语言,其字母与阿拉伯语相似。 我找到了 library转换和更正文本。它工作得很好。当我将转换后的文本显示为 Debug.Log() 时,一切都
我的应用程序支持 4 种不同的语言,其中两种是从右到左编写的。 如果我从 android 系统更改语言然后启动我的应用程序,一切正常。我得到一个镜像布局 (RTL),甚至导航栏也是镜像的。 我的问题是
我正在设计一种布局,该布局在不同的 View 中同时包含英语和希伯来语(旨在从右到左)文本。当一行希伯来语文本超过一定长度时,它会变成从左到右书写(我认为这与长度有关,因为它在较短的文本上看起来很好,
我是一名优秀的程序员,十分优秀!