【问题标题】:How to create a floating help layout?如何创建浮动帮助布局?
【发布时间】:2017-01-19 15:18:03
【问题描述】:

我有一个 {N} 页面,有条件地我想创建一个浮动气泡文本标签,指向页面上的某些功能。例如“按开始按钮就可以了”。

关于如何做到这一点的任何帮助。

最好不要修改 xml 页面文件。

【问题讨论】:

    标签: nativescript


    【解决方案1】:

    我发布了一个插件,可以满足您的要求,只需安装它tns plugin add nativescript-tooltip,然后您可以按如下方式使用它

    打字稿

    import * as frame from "ui/frame";
    import {ToolTip} from "nativescript-tooltip";
    new ToolTip(frame.topmost().getViewById("someView"),{text:"Some Text"});
    

    JavaScript

    const frame = require("ui/frame");
    const ToolTip = require("nativescript-tooltip").ToolTip;
    new ToolTip(frame.topmost().getViewById("someView"),{text:"Some Text"});
    

    Plugin Repo

    【讨论】:

    • 谢谢 - 正是我想要的。不知道为什么两个偷看我的帖子投了反对票 - 合法的问题。
    • android 样式也可以在代码中设置 - 就像 ios 样式一样。你如何设置盒子的位置。我看到箭头位置有一些选项。有人可以说 - 在此按钮视图等下方显示此提示。
    • "android 样式在代码中设置" - atm no new ToolTip(frame.topmost().getViewById("someView"),{text:"Some Text",position:"bottom"});
    • 永远不要对将宝贵的业余时间捐赠给您需要的东西的人说尽快。谢谢你,每一位开源贡献者。
    • 谢谢你,艾迪。 @dashman 你被否决了,因为你没有证明任何研究努力。你基本上说 - 写我的应用程序。
    猜你喜欢
    • 1970-01-01
    • 2011-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-25
    • 2011-08-03
    • 2011-08-15
    相关资源
    最近更新 更多