Android上的Rebol GUI显示太小 [英] Rebol GUI on Android Displays Too Small

查看:114
本文介绍了Android上的Rebol GUI显示太小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我发现了 Rebol ,我很高兴它可以在Android上运行.但是,当我创建一个GUI时,该GUI首先会弹出,并且左上角在屏幕中心,并且我无法移动或调整窗口大小.如果我将手机旋转到水平显示器,则窗口会自动调整大小以适合屏幕大小.然后,我将手机旋转到垂直显示屏,并且窗口正确地填满了屏幕.

但是窗口上的所有东西都是很小的-几乎太小了,无法通过手指点击来进行交互.

我没有看到其他人抱怨这个问题.我该如何解决?我希望这些小部件显示的大小与在我的手机上运行的所有其他应用程序中显示的大小相同.而且,当然,正确地打开窗口,这样我也不必旋转手机两次即可使其正常显示,这也很好.

我在Android(r3-droid.apk)上下载了Rebol(r3-droid.apk).此处./p>

然后我在此处下载了GUI支持.

电话规格:

  • 三星Galaxy Note 3
  • Android 5.0版

生成GUI的代码:

REBOL [title: "Widgets on Screen"]
do %r3-gui.r3
view [
    field
    area
    check
    radio
    text-list
    text-table
    drop-down
    button
]

解决方案

查看演示.在底部字段中键入demo并运行它,以查看如何调整面以适合屏幕尺寸.但正如giuliolunati所说,此建筑物已有2年之久,没有公开维护.

在我的HP 21英寸Android平板电脑上,面孔的尺寸正确,但是运行缓慢.

您最好的选择是观看Red Android分支,该分支将很快承诺GUI.

REBOL []

site: http://development.saphirion.com/experimental/

load-gui
;do site/r3-gui.r3


dpi: gui-metric 'screen-dpi
gui-metric/set 'unit-size dpi / 96
scr: round/floor (gui-metric 'work-size) - gui-metric 'title-size

stylize [
    but: button [
        facets: [
            init-size: 100x48
            max-size: 260x48
            min-size: 24x34
            align: 'center
        ]
    ]
]

view/options [
    title "R3/Droid demos"
    vpanel [
        but "R3GUI widgets" on-action [
            if request/custom/options "R3GUI widgets" [
                vtight [
                    vgroup [
                        prg: progress 50%
                        sld: slider 50% attach 'prg options [min-size: 100x22]
                        button "button"
                        toggle "toggle"
                        drop-down [
                            "Select an option"
                            "Option 1"
                            "Option 2"
                            "Option 3"
                            "Option 4"
                            "Option 5"
                        ]
                        htight [
                            vtight [
                                radio "radio 1"
                                radio "radio 2"
                                radio "radio 3"
                            ]
                            vtight [
                                check "check 1"
                                check "check 2"
                                check "check 3"
                            ]
                        ]
                        field "Some input text"
                        area "more text here"
                        text-list [
                            "text list"
                            "line 2"
                            "line 3"
                            "line 4"
                            "line 5"
                            "line 6"
                            "line 7"
                            "line 8"
                            "line 9"
                            "last line"
                        ]
                        text-table ["1" 80 "2" 50  "3"][
                            ["text table" "a" "10"]
                            ["line 2" "b" "9"]
                            ["line 3" "c" "8"]
                            ["line 4" "d" "7"]
                            ["line 5" "e" "6"]
                            ["line 6" "f" "5"]
                            ["line 7" "g" "4"]
                            ["line 8" "h" "3"]
                            ["line 9" "i" "2"]
                            ["last line" "j" "1"]
                        ] options [show-header: false]
                    ] options [max-hint: [480 auto] box-model: 'frame]
                ] options [max-hint: guie/max-pair pane-align: 'center]
                when [rotate] on-action [
                    win: arg/gob/data
                    bg: first faces? win
                    win/facets/max-hint:
                    bg/facets/max-hint:
                        as-pair arg/offset/x guie/max-coord
                    update-face/no-show/content bg
                ]
            ]["I like that!" "Close"][offset: 0x0 max-hint: reduce [scr/x guie/max-coord]]
            [browse http://development.saphirion.com/donations/ ]
        ]
        but "tile game" on-action [
            request/custom "Downloading files..." [
                title "Loading game..."
                when [enter] on-action [
                    game: load/all site/tile-game.r
                    unview/all
                    gui-metric/set 'unit-size 1x1
                    do game
                ]
            ]["" "Close"]
        ]
        but "graphics test" on-action [
            request/custom "Downloading files..." [
                title "Loading script..."
                when [enter] on-action [
                    script: load/all site/draw-test.r
                    unview/all
                    gui-metric/set 'unit-size 1x1
                    do script
                ]
            ]["" "Close"]
        ]
        but "performace survey" on-action [
            request/custom "Downloading files..." [
                title "Loading test..."
                when [enter] on-action [
                    app: load/all site/dt-01.r
                    unview/all
                    gui-metric/set 'unit-size 1x1
                    do app
                ]
            ]["" "Close"]
        ]
        pad
    ]  options [box-model: 'frame]
    hpanel [
        button "I want donate" on-action [browse http://development.saphirion.com/donations/ ]
        button "close" on-action [
            close-window face
        ]
    ] options [align: 'right]
    when [rotate] on-action [
        win: arg/gob/data
        bg: first faces? win
        win/facets/max-hint:
        bg/facets/max-hint:
            as-pair arg/offset/x max arg/offset/y win/facets/intern/min-heights/1
        update-face/no-show/content bg
    ]
][
    offset: 0x0
    max-hint: scr
]

So I've discovered Rebol, and am thrilled that it runs on Android. When I create a GUI, though, the GUI first pops up with the top left corner in the center of the screen, and I cannot move or resize the window. If I rotate my phone to a horizontal display, the window resizes itself to the screen properly. Then I rotate my phone to a vertical display, and the window fills the screen properly.

But everything on the window is minuscule--almost too small to interact with via finger taps.

I haven't seen anyone else complaining about this issue. How can I fix it? I want the widgets to display the same size they do in every other application that runs on my phone. And, of course, having the window open correctly, so that I don't have to rotate my phone twice to get it to display properly, would be nice, too.

I downloaded Rebol for Android (r3-droid.apk) here.

I then downloaded the GUI support here.

Phone specs:

  • Samsung Galaxy Note 3
  • Android Version 5.0

The code to generate the GUI:

REBOL [title: "Widgets on Screen"]
do %r3-gui.r3
view [
    field
    area
    check
    radio
    text-list
    text-table
    drop-down
    button
]

解决方案

Check out the demo. Type demo at the bottom field and run it to see how to adjust the faces to suit the screen size. But as giuliolunati says, this build is over 2 years old and not publicly maintained.

On my HP 21" Android slate the faces come up the correct size, but it runs very sluggishly.

Your best bet maybe is to watch the Red Android branch which is promising a GUI very soon.

REBOL []

site: http://development.saphirion.com/experimental/

load-gui
;do site/r3-gui.r3


dpi: gui-metric 'screen-dpi
gui-metric/set 'unit-size dpi / 96
scr: round/floor (gui-metric 'work-size) - gui-metric 'title-size

stylize [
    but: button [
        facets: [
            init-size: 100x48
            max-size: 260x48
            min-size: 24x34
            align: 'center
        ]
    ]
]

view/options [
    title "R3/Droid demos"
    vpanel [
        but "R3GUI widgets" on-action [
            if request/custom/options "R3GUI widgets" [
                vtight [
                    vgroup [
                        prg: progress 50%
                        sld: slider 50% attach 'prg options [min-size: 100x22]
                        button "button"
                        toggle "toggle"
                        drop-down [
                            "Select an option"
                            "Option 1"
                            "Option 2"
                            "Option 3"
                            "Option 4"
                            "Option 5"
                        ]
                        htight [
                            vtight [
                                radio "radio 1"
                                radio "radio 2"
                                radio "radio 3"
                            ]
                            vtight [
                                check "check 1"
                                check "check 2"
                                check "check 3"
                            ]
                        ]
                        field "Some input text"
                        area "more text here"
                        text-list [
                            "text list"
                            "line 2"
                            "line 3"
                            "line 4"
                            "line 5"
                            "line 6"
                            "line 7"
                            "line 8"
                            "line 9"
                            "last line"
                        ]
                        text-table ["1" 80 "2" 50  "3"][
                            ["text table" "a" "10"]
                            ["line 2" "b" "9"]
                            ["line 3" "c" "8"]
                            ["line 4" "d" "7"]
                            ["line 5" "e" "6"]
                            ["line 6" "f" "5"]
                            ["line 7" "g" "4"]
                            ["line 8" "h" "3"]
                            ["line 9" "i" "2"]
                            ["last line" "j" "1"]
                        ] options [show-header: false]
                    ] options [max-hint: [480 auto] box-model: 'frame]
                ] options [max-hint: guie/max-pair pane-align: 'center]
                when [rotate] on-action [
                    win: arg/gob/data
                    bg: first faces? win
                    win/facets/max-hint:
                    bg/facets/max-hint:
                        as-pair arg/offset/x guie/max-coord
                    update-face/no-show/content bg
                ]
            ]["I like that!" "Close"][offset: 0x0 max-hint: reduce [scr/x guie/max-coord]]
            [browse http://development.saphirion.com/donations/ ]
        ]
        but "tile game" on-action [
            request/custom "Downloading files..." [
                title "Loading game..."
                when [enter] on-action [
                    game: load/all site/tile-game.r
                    unview/all
                    gui-metric/set 'unit-size 1x1
                    do game
                ]
            ]["" "Close"]
        ]
        but "graphics test" on-action [
            request/custom "Downloading files..." [
                title "Loading script..."
                when [enter] on-action [
                    script: load/all site/draw-test.r
                    unview/all
                    gui-metric/set 'unit-size 1x1
                    do script
                ]
            ]["" "Close"]
        ]
        but "performace survey" on-action [
            request/custom "Downloading files..." [
                title "Loading test..."
                when [enter] on-action [
                    app: load/all site/dt-01.r
                    unview/all
                    gui-metric/set 'unit-size 1x1
                    do app
                ]
            ]["" "Close"]
        ]
        pad
    ]  options [box-model: 'frame]
    hpanel [
        button "I want donate" on-action [browse http://development.saphirion.com/donations/ ]
        button "close" on-action [
            close-window face
        ]
    ] options [align: 'right]
    when [rotate] on-action [
        win: arg/gob/data
        bg: first faces? win
        win/facets/max-hint:
        bg/facets/max-hint:
            as-pair arg/offset/x max arg/offset/y win/facets/intern/min-heights/1
        update-face/no-show/content bg
    ]
][
    offset: 0x0
    max-hint: scr
]

这篇关于Android上的Rebol GUI显示太小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆