Question

I have a Android application that includes a xml file that includes a scrolview and I added some buttons in this layout and I want to add more buttons (when I add on graphical layout content get defaced) but I can't add more here is also my xml file

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DualarMainActivity" >

 <RelativeLayout
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="@drawable/dualarbackround"
     android:orientation="vertical" >

<Button
    android:id="@+id/button6"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/button5"
    android:layout_alignRight="@+id/button2"
    android:layout_below="@+id/button5"
    android:layout_marginTop="20dp"
    android:text="Button" />

<Button
    android:id="@+id/button3"
    android:layout_width="248dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/button2"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="20dp"
    android:text="Button" />

<Button
    android:id="@+id/button2"
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/button3"
    android:layout_below="@+id/button1"
    android:layout_marginTop="20dp"
    android:text="Button" />

<Button
    android:id="@+id/button1"
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_alignRight="@+id/button3"
    android:layout_marginTop="240dp"
    android:text="Button" />

<Button
    android:id="@+id/button4"
    android:layout_width="256dp"
    android:layout_height="wrap_content"
    android:layout_below="@+id/button3"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="20dp"
    android:text="Button" />

<Button
    android:id="@+id/button5"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/button3"
    android:layout_alignRight="@+id/button4"
    android:layout_below="@+id/button4"
    android:layout_marginTop="20dp"
    android:text="Button" />

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:src="@drawable/bismillah" android:contentDescription="TODO"/>

<Button
    android:id="@+id/button7"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/button1"
    android:layout_alignRight="@+id/button1"
    android:layout_below="@+id/imageView1"
    android:layout_marginTop="50dp"
    android:text="Button" />

<Button
    android:id="@+id/button8"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/button7"
    android:layout_alignLeft="@+id/button4"
    android:layout_alignRight="@+id/button7"
    android:layout_marginBottom="65dp"
    android:text="Button" />

      </RelativeLayout>
  </ScrollView>
Was it helpful?

Solution

okey ı have solve the problem while changing

 <RelativeLayout
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:background="@drawable/dualarbackround"
 android:orientation="vertical" >

TO

 <RelativeLayout
 android:layout_width="match_parent"
 android:layout_height="1500dp"
 android:background="@drawable/dualarbackround"
 android:orientation="vertical" >

(I HAVE CHANGED RELATİVE LAYOUT'S HEIGHT WRAP CONTENT TO ANOTHER NUMBER WİTH THE UNIT OF db (density pixel) )

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top