- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在构建一个阿拉伯语应用程序,所以它是 RTL 语言我已尝试安装该程序包 @nativescript-rtl/ui
。
但是布局并没有真正发生任何变化!还是和LTR一样
( I tried the plugin on tabs sample from NativeScript angular )
然后我在 app.module.ts
上注册了 RTL 元素,就像文档中显示的那样:
import * as rtl from '@nativescript-rtl/ui'
registerElement(
"RGridLayout",
() => rtl.GridLayout
);
registerElement(
"RWrapLayout",
() => rtl.WrapLayout
);
registerElement(
"RAbsoluteLayout",
() => rtl.AbsoluteLayout
);
registerElement(
"RDockLayout",
() => rtl.DockLayout
);
registerElement(
"RStackLayout",
() => rtl.StackLayout
);
然后我在 app.component.html
RStackLayout
<RStackLayout>
<Tabs selectedIndex="0" tabsPosition="bottom">
<TabStrip>
<!--
Besides the approach demonstrated below there is alternative shorthand syntax for setting TabStripItem title and icon:
<TabStripItem title="Home" iconSource="res://tabIcons/home" />
Both shorthand and verbose syntax can use
TabStripItem Label {...} css selector to style the title label,
and TabStriptItem Image {...} css selector to style the icon image (see _app-common.scss).
Note that when working with font icons we recommend the usage of the verbose syntax as it
is explicit and describes better the need to provide font icon as well as set the respective font (e.g. via class name).
-->
<TabStripItem>
<!--
Note TabStripItem will only accept single Label and/or single Image elements that it
will "adopt"; any other layout elements you try to specify will be ignored
-->
<Label text="Home"></Label>
<Image src="font://" class="fa t-36"></Image>
</TabStripItem>
<TabStripItem>
<Label text="Browse"></Label>
<Image src="font://" class="fa t-36"></Image>
</TabStripItem>
<TabStripItem>
<Label text="Search"></Label>
<Image src="font://" class="fa t-36"></Image>
</TabStripItem>
</TabStrip>
<TabContentItem>
<page-router-outlet name="homeTab"></page-router-outlet>
</TabContentItem>
<TabContentItem>
<page-router-outlet name="browseTab"></page-router-outlet>
</TabContentItem>
<TabContentItem>
<page-router-outlet name="searchTab"></page-router-outlet>
</TabContentItem>
</Tabs>
</RStackLayout>
我尝试了一些阿拉伯语文本,它被重定向到 RTL 但 Tabs 不是 RTL!如何将其强制为 RTL 元素
最佳答案
在 TabView
的 loaded
事件中,您可以将布局方向设置为 RTL
。
onTabViewLoaded(event) {
if (event.object.android) {
event.object.android.setLayoutDirection(android.util.LayoutDirection.RTL);
}
}
如果您还没有安装 tns-platform-declarations
,请使用 declare 语句。
declare var android;
关于javascript - 如何默认将 NativeScript 设置为 RTL 布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58192530/
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 中同时包含英语和希伯来语(旨在从右到左)文本。当一行希伯来语文本超过一定长度时,它会变成从左到右书写(我认为这与长度有关,因为它在较短的文本上看起来很好,
我是一名优秀的程序员,十分优秀!