EarlGrey
EarlGrey

Reputation: 531

How can I create a View, which allows larger children?

I need to implement a View, containing a RelativeLayout.

The parent View (black) and the child View (red)
Also, the RelativeLayout should be able to be moved and therefor change the visible part in the parent View. Unfortunately, Android doesn't let me do this. The child is allways clipped down to fit inside the parent.
I stumbled across ScrollView and HorizontalScrollView allready, but they allow the user to scroll around and that's not what I want him to be able to. There's just this too big RelativeLayout of which I want to show the user a just a part of.

Everything is added to the screen programmatically, without XML.

Is it possible? Maybe I haven't seen some obvios possibilities with ScrollView?

Upvotes: 3

Views: 702

Answers (2)

axl coder
axl coder

Reputation: 749

As you suggest you can use a ScrollView and disable scrolling in this view.

To do this read this answer:

Disable ScrollView Programmatically?

;)

Upvotes: 1

Related Questions