iOS Question Line Break to Button

Discussion in 'iOS Questions' started by tufanv, Jun 19, 2015.

  1. tufanv

    tufanv Expert Licensed User


    I want to make my button 2 lines. I am using line1 & crlf & line2 but line 2 is not visible. How do i do it ?

  2. Filippo

    Filippo Expert Licensed User

    That should work.;)

    Public Sub SetMultiline(b As Button)
    Dim no As NativeObject = b
    End Sub
    Pooya1 and Erel like this.
  3. tufanv

    tufanv Expert Licensed User

    Works Excellent! Ty!
  4. sdesan

    sdesan Member Licensed User

    it's my first 'convertion' from b4a in b4i and for button description i have the multiline problem
    this is my code
    Sub Process_Globals
    'These global variables will be declared once when the application starts.
       'Public variables can be accessed from all modules.
       Public App As Application
    Public NavControl As NavigationController
    Private Main1 As Page
    Private princi As Page
    Private ImageView1 As ImageView
    Dim MyButton As Button
    End Sub

    Private Sub Application_Start (Nav As NavigationController)
       NavControl = Nav
       Main1.Title = 
    "My App 1st page"
       NavControl.NavigationBarVisible = 
       MyButton .Initialize(
    "MyButton ",MyButton .STYLE_SYSTEM)
       SetMultiline(MyButton )
    End Sub

    Sub ImageView1_Click
      princi.Title = 
    "My App 2nd page"
    End Sub

    Public Sub SetMultiline(b As Button)
    Dim no As NativeObject = b
    End Sub
    The button with multiline is on the second page (principal) but i don't view a multiline: what's my error?!?
    Thank you
  5. Erel

    Erel Administrator Staff Member Licensed User

    Are you also adding MyButton with the designer? If yes then you shouldn't initialize it in your code. Instead you should call SetMultiline after loading the layout.
  6. sdesan

    sdesan Member Licensed User

    Perfect, thank you
  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