当前位置: 首页 > 软件库 > 手机/移动开发 > >

ui

授权协议 MIT License
开发语言 JavaScript TypeScript
所属分类 手机/移动开发
软件类型 开源软件
地区 不详
投 递 者 哈和惬
操作系统 iOS
开源组织
适用人群 未知
 软件概览

@nativescript-rtl/ui

Add right-to-left UI support to NativeScript framework

Installation

to install plugin write:

NativeScript 7 and higher

tns plugin add @nativescript-rtl/ui

Support NativeScript older then version 7

tns plugin add @nativescript-rtl/ui@0.1.7

Preview

LTR Layout RTL
screenshot 1 AbsoluteLayout screenshot 1
screenshot 2 DockLayout screenshot 2
screenshot 3 GridLayout screenshot 3
screenshot 4 StackLayout screenshot 4
screenshot 5 WrapLayout screenshot 5

Properties

Name Default Description
isRtl true isRtl use to change layout direction by default is true that mean layout from right to left but you can change it to false that change layout direction from left to right

CSS Properties

Name Default Description
direction rtl use to change layout direction by default is rtl that mean layout from right to left but you can change it to ltr that change layout to direction from left to right

How to use

declare plugin in XML then use it.

<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:rtl="@nativescript-rtl/ui">
  <rtl:WrapLayout orientation="horizontal" width="210" height="210" backgroundColor="lightgray">
    <Label text="Label 1" width="70" height="70" backgroundColor="red"/>
    <Label text="Label 2" width="70" height="70" backgroundColor="green"/>
    <Label text="Label 3" width="70" height="70" backgroundColor="blue"/>
    <Label text="Label 4" width="70" height="70" backgroundColor="yellow"/>
  </rtl:WrapLayout>
</Page>

For Angular/Vue 'registerElement` must be used to register each RTL element

example:register elements in app.module.ts

import { registerElement } from "nativescript-angular/element-registry";
registerElement(
  "RGridLayout",
  () => require("@nativescript-rtl/ui").GridLayout
);
registerElement(
  "RWrapLayout",
  () => require("@nativescript-rtl/ui").WrapLayout
);
registerElement(
  "RAbsoluteLayout",
  () => require("@nativescript-rtl/ui").AbsoluteLayout
);
registerElement(
  "RDockLayout",
  () => require("@nativescript-rtl/ui").DockLayout
);
registerElement(
  "RStackLayout",
  () => require("@nativescript-rtl/ui").StackLayout
);

now you can use RGridLayout, RWrapLayout, RAbsoluteLayout, RDockLayout and RStackLayout in your angular project

example:

<RWrapLayout orientation="horizontal" width="210" height="210" backgroundColor="lightgray">
    <Label text="Label 1" width="70" height="70" backgroundColor="red"></Label>
    <Label text="Label 2" width="70" height="70" backgroundColor="green"></Label>
    <Label text="Label 3" width="70" height="70" backgroundColor="blue"></Label>
    <Label text="Label 4" width="70" height="70" backgroundColor="yellow"></Label>
  </RWrapLayout>
  • iView UI组件库 iView 是一套基于 Vue.js 的开源 UI 组件库,主要服务于 PC 界面的中后台产品。iView的组件还是比较齐全的,更新也很快,文档写得很详细。有公司团队维护,比较可靠的Vue UI组件框架。iView生态也做得很好,还有开源了一个iView Admin,做后台非常方便。官网上介绍,iView已经应用在TalkingData、阿里巴巴、百度、腾讯、今日头条、京东

 相关资料
  • 问题内容: 我对事实背后的想法有一个疑问,那就是只有这个属性。为什么在接口中未指定属性?您现在可能会说这是由于向后兼容性,但是我更愿意破坏兼容性,让实现该接口的用户还为prependId事情实现方法。 就组件中的prependId而言,我的主要问题是,它会中断, 我希望如果我使用,行为会发生变化,不仅与渲染有关,而且还与想要在组件树中搜索组件有关。 这里有个简单的例子: 现在,当我想获取panel

  • 问题内容: 我有一个需要从服务器提取数据并将其插入到SQLite数据库中以响应用户输入的应用程序。我认为这将非常简单- 从服务器提取数据的代码是AsyncTask的一个非常简单的子类,并且它的工作原理完全符合我的预期,而无需挂起UI线程。我使用一个简单的接口为其实现了回调功能,并将其包装在静态类中,因此我的代码如下所示: 一切还不错。即使服务器花费一个小时来检索数据,UI仍然可以平稳运行,因为ge

  • 问题内容: 假设我在TreeTableView中有2列,现在我想在第一列中添加一个字符串/标签,在另一列中添加一个ProgressBar。我将如何完成这样的事情? 非常感谢任何帮助! 问题答案: 正如James_D正确指出的,您可以将其用于带有ProgressBars的列。有内部支撑为如某些其他用户界面控件,等 对于其他UI控件,您可以创建一个Custom ,如下所示: 然后将a分配给第二列 在其

  • 问题内容: 用户William建议我将展示插页式广告的代码更改为此 并为此显示广告: 在游戏中的每次游戏结束时,我都会遇到以下错误: 怎么了 请尽可能简单地向我解释,因为我是新手,之前没有任何编程知识:)谢谢! 问题答案: 这可能不是完整的答案,但是很难说出正确的答案,因为上面的代码尚不清楚。您没有显示在哪里使用GameOver(),但我认为您在错误的位置调用了它,我认为您在任何后台线程中都调用了

  • 问题内容: 我有一个测试用例,可以访问浏览器并对其进行处理。但是我需要以编程方式更改某些文本框的输入内容。我有8个字符串和一个布尔值,表示测试需要正确运行。问题是,您必须先通过ant和构建过程运行测试用例,然后才能实际运行它。我希望能够构建它,将其放在设备上,然后在我调用它时以某种方式将数据传递给设备。但是我不知道那是否可能。我目前唯一想到的选择是编写一个快速的Java程序,将其写入文件,更改变量

  • 问题内容: 测试UI很困难。您认为Swing的最佳单元测试框架是什么? 问题答案: 我认为目前最好的是FEST。

  • 问题内容: 我设法使通知在较旧的API中起作用,但在Oreo中不起作用。创建通知会导致我的应用程序仍然可以正常运行(logcat中没有消息),但是在Activity运行时,SystemUI崩溃并以无休止的周期重启。这是systemcat进程的logcat错误: 我的代码: 我在创建的MediaPlayerService的onCreate上初始化了mNotificationUtils。 问题答案:

  • 问题内容: 我发现我的某些活动在启动时被阻止。因此,我在一个新项目中编写了该代码: 结果是第一次创建AdView对象会阻塞UI线程1到2秒钟。 有什么办法可以避免这种情况? 谢谢 问题答案: 您正在UI线程中创建AdView,这就是被阻止的原因。在AdView初始化期间,线程不会执行其他任何操作。 您可以尝试在另一个线程中加载AdView,也可以使用AsyncTask以用户界面安全的方式加载它。