https://kotlinlang.org logo
#anko
Title
a

anthonyandroid

12/17/2016, 5:06 PM
A simple question confused me for long: as I know if I want to use
lparams()
method from Anko, it looks like I must use it inside
linearLayout
or `verticalLayout`(or inside any other ViewGroup), is that right? What if I want to make a custom view, and I start the code like this:
Copy code
class CustomViewGroup(): LinearLayout() {
init {
        linearLayout {
           lparams {
        ( and I do some custom things here)
             }
        }
    }
}
These code works and I did make the view I want, but it looks like I wrap my custom view with double
LinearLayout
, one is the constructor method and the second one is when trying to inflate my layout with Anko. But if I don't use the second one, I can't use the
lparams
method...