omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. nerdtron

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    nerdtron

    @nerdtron

    0
    Reputation
    998
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    nerdtron Unfollow Follow

    Latest posts made by nerdtron

    • RE: Need UI layout help

      @Phuket2 thank you very much for the reply and help! Been tied up with other stuff and so have been delayed in getting back to this. I gave that a try and it looked great! I'm curious, though, any thoughts on how to set it up so that when you rotate the device its still correct? I see you're not using flex and from the docs it seems that this is how dynamic layout is normally done. Maybe its a matter of just re-computing using your code when the orientation changes?

      posted in Pythonista
      nerdtron
      nerdtron
    • Need UI layout help

      I’m trying to create a simple UI in Pythonista for my iPhone 6.

      I’d like to have a single line text box and a button at the top of the screen. The button should be at the upper right and be sized to fit the button’s name text.

      The text box should be the same height as the button and be located to the left of the button and fill the remaining width. I will then fill the remainder of the screen with a SceneView (not yet added).

      The idea is that you can type some text into the text field and then click the button to apply the text to the scene. I would rather not use a layout file and keep it all in a single script file so I’m trying to do it from code.

      I’ve experimented with this using the UI module docs but can’t get it quite working.

      Here’s what I have. Any suggestions on how to get this to do what I want?

      import ui

      view = ui.View()
      view.name = 'test UI'
      view.background_color = 'black'

      r = ui.Button(title='Add Item')
      r.background_color = 'orange'
      r.flex = 'BL'
      view.add_subview(r)

      s = ui.TextField()
      s.flex = 'BR'
      view.add_subview(s )

      view.present('fullscreen')

      posted in Pythonista
      nerdtron
      nerdtron