Android Question Problem with CustomView

Discussion in 'Android Questions' started by Pucci0095, Feb 9, 2018.

  1. Pucci0095

    Pucci0095 New Member Licensed User

    Hi all.

    I'm new to the forum.


    I've a little problem with custom class.

    how can I turn my Base Panel into view, so that I can add it via code in an activity or another object, like a list?
    EXAMPLE:


    Code:
    Sub Globals

    Dim myButton As mybutton

    End sub

    Sub Activity_Create(FirstTime As Boolean)

    Activity.LoadLayout("mylayout")
    myButton.Initialize(Me,
    "mybutton")

    Activity.AddView(myButton,50dip,50dip,50dip,50dip)


    End Sub
    But custom view isn't a normal object. I had try to create in my customview's code a method to convert my panel to view.

    But no positive result.
    Anyone can help me ?





    Thanks to anyone willing to help me:)
     
  2. LucaMs

    LucaMs Expert Licensed User

  3. klaus

    klaus Expert Licensed User

    You might have a look at the B4X CustomViews booklet, link in my signature.
    It includes example projects with source code.
     
  4. Pucci0095

    Pucci0095 New Member Licensed User

    Thanks a lot. The answares are very appreciate!
     
    Last edited: Feb 11, 2018
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