0

I created custom view and want to insert multiple numbers of it to the Scroll list, but always only one view is displayed:

  <ScrollView 
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_below="@+id/buttonsPart"
  android:id="@+id/scrollView1"
  android:background="@drawable/greylayer">

  <LinearLayout 
      android:layout_width="match_parent"
      android:layout_height="wrap_content">

       <com.test.app.canvas.MatchCanvas
      android:layout_width="fill_parent"
      android:layout_height="400px"/>

      <com.test.app.canvas.MatchCanvas
      android:layout_width="fill_parent"
      android:layout_height="400px"/>

  </LinearLayout>

I believe its easily possible to insert as many custom views to ScrollView, but somehow I still have only 1 instance of MatchCanvas. What should I do?

2
  • Not the problem, but as an FYI, you don't want to use px, use dp (density independent pixels) instead. Commented Jul 26, 2012 at 20:39
  • @dmon Can I ask a few question in chat about android multiple screen size support? Commented Jul 26, 2012 at 20:46

1 Answer 1

4

By default LinearLayout is horizontal, so add android:orientation="vertical" to the LinearLayout to resolve the issue.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.