Computer scienceMobileAndroidUser InterfaceUI components

Instantiating Views programmatically

Attaching to a parent

Report a typo

Which class should you use to specify how the View is positioned within its parent?

setContentView(RelativeLayout(this).apply {

    addView(TextView(context).apply {
        text = "I'm inside a RelativeLayout"
    }, ___________________________(MATCH_PARENT, WRAP_CONTENT))

}, FrameLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT))
Enter a short text
___

Create a free account to access the full topic