iOS Question Show Hide TopRightButtons Items

Discussion in 'iOS Questions' started by abhishek007p, May 20, 2015.

  1. abhishek007p

    abhishek007p Active Member Licensed User

    How do I Show and Hide TopRightButtons Items?

    in my scenario.
    I have a multiline TextView, when keyboard opens it covers most of the control, there is no way to go back, the done button on textview works as enter key. so I am displaying a Done button on top right toolbar.

    when the user click Done button I close the keyboard, then I want to hide this Done button. and show again when the textview gets focus. I also want to display a button/image item when keyboard is not open.

    Thanks
     
    Last edited: May 20, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can add a button above the keyboard: http://www.b4x.com/android/forum/threads/input-accessory-views.51000/#post-318960

    You can remove and add buttons to the TopRightButtons at runtime. If you like to hide or show the buttons you can do something like:
    Code:
    Dim buttons As List = NavControl.TopRightButtons
    NavControl.TopRightButtons = 
    Array()
    'later you can return the buttons with:
    NavControl.TopRightButtons = buttons
     
  3. abhishek007p

    abhishek007p Active Member Licensed User

    Sorry, i dont understand. can you post a simple working example?

    Many questions like How to i define what type of button/item i want to set, how to handle events, set its text or image etc.

    This code crashes the app
    Code:
    Page1.TopRightButtons.Initialize
    Page1.TopRightButtons = 
    Array("Done1""Done2")
    in my scenario, i have a textview and
    When Keyboard is visible - i want to Display a Done button
    When Keyboard is not visible - i want to Display a Image Based Button
     
  4. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice