【问题标题】:how i change my fontSize. when screen Size change?我如何改变我的字体大小。当屏幕尺寸改变?
【发布时间】:2012-02-14 07:28:28
【问题描述】:

我想创建一个支持所有类型窗口大小的多平台应用程序。 但是当我的窗口高度或宽度比我的 fontSize 变化时没有变化。 我想用高度或宽度的百分比来改变它的大小。 我该怎么办?

请帮助我。 提前致谢。

【问题讨论】:

    标签: titanium titanium-mobile titanium-modules


    【解决方案1】:

    这太容易了。

    首先你检查你的窗口高度或宽度大小

    var curHeight = Titanium.Platform.displayCaps.platformHeight;
    var curWidth = Titanium.Platform.displayCaps.platformWidth;
    

    然后根据您的要求进行设置。

    font:{fontSize = Titanium.Platform.displayCaps.platformWidth*25/100},
    

    font : {fontSize = curWidth*25/100},
    

    【讨论】:

    • 非常感谢。早点联系你
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-27
    相关资源
    最近更新 更多