0

I am trying to develop a block representation with inputs and outputs. The main ideia is:

  1. A user can add outputs/inputs
  2. A user can edit the ouputs/inputs added

So we have something like this:

enter image description here

I managed to build a dynamic canvas that changes when the user presses one of the buttons (the painted area grows).

The problem starts when the canvas is bigger than screen height. The result is something like this:

enter image description here

Notice that I have a scroll view. However it seems that scrollview puts everything in black. My xml file is something like this:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillViewport="true"> <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <pt.mypackage.BlockCanvas android:layout_width="fill_parent" android:layout_height="wrap_content" /> <EditText ... /> <Button ... /> <Button ... /> </RelativeLayout> </ScrollView> 
2
  • 1
    Can you elaborate what the actual question is? Commented Jan 31, 2012 at 22:22
  • If you want a question I can put it like that: Why the black screen is appearing? I know it only appears when the canvas gets bigger than screen height. But Why? Commented Feb 1, 2012 at 0:34

1 Answer 1

0

I've experience something similar to your problem, I solved it by wrapping up the scroll view with RelativeLayout and using android:layout_allignParentTop="true". If doesnt work try adding empty view(no height just width) that will work as anchor to which your ScrollView will be placed below. I hope this makes sense and works

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.