Scrollview Realigns textView - android

I have a blank activity which contains many text view so I want to use scrollview but whenever I use it the text views shift from their preassigned position to the top.Before adding ScrollView and
After adding ScrollView here's the xml code
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OFF"
android:id="#+id/button"
android:onClick="torchToggle"
android:layout_below="#+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginTop="71dp"
android:background="#cdc6c6" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Torch"
android:id="#+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textColor="#e8d9d9" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="#+id/textView2"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textColor="#dacece"
android:text="#Error In display" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="#+id/textView3"
android:layout_below="#+id/textView2"
android:layout_centerHorizontal="true"
android:layout_marginTop="83dp"
android:textColor="#cdc0c0"
android:text="#Error in display" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="#+id/textView4"
android:textColor="#f3ef7a"
android:layout_below="#+id/textView3"
android:layout_centerHorizontal="true"
android:text="#Error in display" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/progressBar"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="next"
android:id="#+id/button2"
android:layout_alignTop="#+id/button"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:nestedScrollingEnabled="false"
android:onClick="nextActivity" />
</RelativeLayout>
</ScrollView>

The height of your RelativeLayout is falling back to wrap_content when inside the ScrollView as the virtual height of the ScrollView is infinite and match_parent doesn't make sense.
You could try adding android:fillViewport="true" to the ScrollView. This will give the RelativeLayout a minimum height of match_parent. You should change the RelativeLayout's layout_height to wrap_content.

Related

ScrollView is not scrolling?

Ok I am trying to create a screen with a lot of buttons on it, obviously I ran out of space so I set my layout to a ScrollView with a relative layout underneath it and then placed all of my buttons inside that.
heres the code:
<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="1000dp" android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
android:fillViewport="true"
tools:context="com.cecode.www.gjcode.MainTypes"
android:animateLayoutChanges="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Options Menu(placeholder)"
android:id="#+id/optionsBtn"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:layout_width="400dp"
android:layout_height="80dp"
android:text="Top Text"
android:id="#+id/button1"
android:layout_marginTop="110dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
/>
<Button
android:layout_width="400dp"
android:layout_height="80dp"
android:text="placeholder text"
android:id="#+id/button2"
android:layout_marginTop="20dp"
android:layout_below="#+id/button1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:layout_width="400dp"
android:layout_height="80dp"
android:text="placeholder text"
android:id="#+id/button3"
android:layout_marginTop="20dp"
android:layout_below="#+id/button2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:layout_width="400dp"
android:layout_height="80dp"
android:text="placeholder text"
android:id="#+id/button4"
android:layout_marginTop="20dp"
android:layout_below="#+id/button3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="mid text"
android:id="#+id/textView3"
android:layout_below="#+id/button4"
android:layout_alignRight="#+id/optionsBtn"
android:layout_alignEnd="#+id/optionsBtn"
android:layout_marginTop="37dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="bottom text"
android:id="#+id/textView4"
android:layout_alignParentBottom="true"
android:layout_alignLeft="#+id/textView3"
android:layout_alignStart="#+id/textView3" />
</RelativeLayout>
</ScrollView>
heres a screenshot of the screen-
My problem is that when I test this on a device it will not scroll past the mid text point, so I cannot get to the bottom text bit. Thanks!
replace
android:layout_height="1000dp"
with
android:layout_height="match_parent"
and let me know if it works
ok as you specified as per your requirement you can use LinearLayout with verticla orientation and between mid and bottom text put another linear layout with wrap_content height to add your buttons if you want some space before adding buttons to it you can specify minheight to layout take look at below code
<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" android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
android:fillViewport="true"
tools:context="com.cecode.www.gjcode.MainTypes"
android:animateLayoutChanges="true">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Options Menu(placeholder)"
android:id="#+id/optionsBtn"
/>
<Button
android:layout_width="400dp"
android:layout_height="80dp"
android:text="Top Text"
android:id="#+id/button1"
android:layout_marginTop="110dp"
/>
<Button
android:layout_width="400dp"
android:layout_height="80dp"
android:text="placeholder text"
android:id="#+id/button2"
android:layout_marginTop="20dp"
/>
<Button
android:layout_width="400dp"
android:layout_height="80dp"
android:text="placeholder text"
android:id="#+id/button3"
android:layout_marginTop="20dp"
/>
<Button
android:layout_width="400dp"
android:layout_height="80dp"
android:text="placeholder text"
android:id="#+id/button4"
android:layout_marginTop="20dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="mid text"
android:id="#+id/textView3"
/>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="50dp"
android:orientation="vertical">
<!-- add your button here -->
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="bottom text"
android:id="#+id/textView4"
/>
</LinearLayout>
</ScrollView>
it is really hard to catch your requirements. Let me explain how it works at the moment. ScrollView doesn't give exact height so when you set match_parent for relative layout I guess it sets max height for this view - Integer.MAX_VALUE. That is why Android Studio warns you to change match_parent to wrap_content.
If you need this view in the bottom - set the margin of your bottom view in runtime.

My scroll view does't shows the last relative layout

When I scroll my contents the last RelativeLayout cannot be shown in the Activity. I have a LinearLayout inside a ScrollView . The LinearLayout have many RelativeLayout's (I have shown only one) with views. Now the problem is the last RelativeLayout does't appears when I scroll down.
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="35dp"
android:orientation="vertical"
android:paddingLeft="10dp"
android:weightSum="3" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:gravity="center_vertical"
android:paddingLeft="10dp" >
<CheckBox
android:id="#+id/thursday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Thursday" />
<TextView
android:id="#+id/tvTime6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:text="Time" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:gravity="center_vertical"
android:paddingLeft="10dp" >
<CheckBox
android:id="#+id/friday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Friday" />
<TextView
android:id="#+id/tvTime7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:text="Time" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
please remove
android:layout_marginTop="35dp"
from LinearLayout.
if you want to gap between ActionBar to your List add margin top to ScrollView

LinearLayout put child at the right side

I m trying to have a textview and a button in linear layout with horizontal orientation. The textview should appear at the starting and the button should appear at the end. I thought giving gravity right to the button would do the trick but the buttons doesn't move to the right side. I m thinking if I should probably use relative layout?
<\LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/productPriceTextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rs 3579.0"
/>
<Button
android:id="#+id/buyNowButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Buy Now" />
<\/LinearLayout>
My way (using a RelativeLayout):
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/productPriceTextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="Rs 3579.0"
/>
<Button
android:id="#+id/buyNowButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="Buy Now"
/>
</RelativeLayout>
See how I explicitly align the TextView to the Parent's left side and the Button to the Parent's right side
You can then center the TextView vertically in the RelativeLayout, by setting:
android:layout_centerVertical="true"
in the TextView itself
Newr OS versions may prefer this:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/productPriceTextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:text="Rs 3579.0"
/>
<Button
android:id="#+id/buyNowButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:text="Buy Now"
/>
</RelativeLayout>
Try below xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/productPriceTextView1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="Rs 3579.0"
/>
<Button
android:id="#+id/buyNowButton1"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Buy Now" />
</LinearLayout>
There is a cleaner way to do this, using LinearLayout : just give the left element a width of 0 and a weight of 1, and set the right one's width on wrap_content. And that's it!
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/productPriceTextView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Rs 3579.0"
/>
<Button
android:id="#+id/buyNowButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Buy Now" />
</LinearLayout>
There are two approach:
1) You can use RelativeLayout in which you can drag your Button where you want..
2) You can use weight property for LinearLayout.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/productPriceTextView1"
android:layout_width="0dp"
android:layout_weight="0.8"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="Rs 3579.0"
/>
<Button
android:id="#+id/buyNowButton1"
android:layout_width="0dp"
android:layout_weight="0.2"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Buy Now" />
</LinearLayout>
Use this layout instead..
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/productPriceTextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rs 3579.0"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:id="#+id/buyNowButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Buy Now"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
use android:layout_gravity="end" to your linear layout to move all the elements to the right
Another simple solution here that doesn't rely on using a RelativeLayout is having an empty view between both elements using layout_weight to make sure it fills the empty space.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/productPriceTextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rs 3579.0"/>
<view
android:layout_height="0dp"
android:layout_width="0dp"
android:layout_weight="1" />
<Button
android:id="#+id/buyNowButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Buy Now" />
</LinearLayout>
That way you can achieve what you want by only using a LinearLayout, now, I am not sure if this is more efficient than using a RelativeLayout. But for me it always feels a bit like an overkill to go for a relative in such a simple layout.
Just add empty view with 0dp width and 1 weight
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/productPriceTextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rs 3579.0"
/>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<Button
android:id="#+id/buyNowButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Buy Now" />
</LinearLayout>

basic android scroll bars not visible

<RelativeLayout 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" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Choose Details"
android:id="#+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Year"
android:id="#+id/textView2"
android:layout_below="#+id/textView"
android:layout_alignParentLeft="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Branch"
android:id="#+id/textView3"
android:layout_below="#+id/textView2"
android:layout_alignParentLeft="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Semester"
android:id="#+id/textView4"
android:layout_below="#+id/textView3"
android:layout_alignParentLeft="true"/>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scrollView"
android:layout_alignTop="#+id/textView2"
android:layout_alignParentRight="true"/>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scrollView2"
android:layout_alignTop="#+id/textView4"
android:layout_alignParentRight="true"/>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scrollView3"
android:layout_below="#+id/textView4"
android:layout_alignRight="#+id/scrollView2"/>
</RelativeLayout>
I am bit new to android.Could anyone tel me that why arent the three scroll bars visible along the text views.I want to display the scrolls adjacent to their respective textviews.Moreover is the relative layout the best way to align the widgets .
Until and unless, you add View element in ScrollView, the ScrollViews which u have added cannot be visible, but they are present in layout. ScrollView must contain a single View item either it is a LinearLayout, RelativeLayout with child views such as TextView, ImageView, EditText, Button as below:
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scrollView2"
android:layout_alignTop="#+id/textView4"
android:layout_alignParentRight="true">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="#+id/image1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp" />
</LinearLayout>
</ScrollView>
or a View element as a single child for ScrollView as below:
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scrollView2"
android:layout_alignTop="#+id/textView4"
android:layout_alignParentRight="true">
<ImageView
android:id="#+id/image1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"/>
</LinearLayout>
</ScrollView>
A scroll view is not a scroll bar.
It must contain some elements.
Example :
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#+id/imageView1" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Button
android:id="#+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Button" />
<Button
android:id="#+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Button" />
<Button
android:id="#+id/button3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Button" />
</LinearLayout>
</ScrollView>
Your code should be
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Choose Details"
android:id="#+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Year"
android:id="#+id/textView2"
android:layout_below="#+id/textView"
android:layout_alignParentLeft="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Branch"
android:id="#+id/textView3"
android:layout_below="#+id/textView2"
android:layout_alignParentLeft="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Semester"
android:id="#+id/textView4"
android:layout_below="#+id/textView3"
android:layout_alignParentLeft="true"/>
<ScrollView/>
The ScrollView in your layout is not visible because your it does not contain any widget with height and width. If you want to see your ScrollView then you have to set some value to the width and height (for example android:layout_width="40dip") properties, and a backgroundColor(), after this you will able to see you ScrollView.
1) Use LinearLayout instead of RelativeLayout, set android:orientation="vertical"
2) Put the textview inside your scrollview, like this:
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
...
</TextView>
</ScrollView>
If you put all textviews inside a single scrollview, you will have one scrollbar(Note however that scrollview can only contain one child view, so you'll need to wrap those textviews under a linear layout); if you put one text view in each scrollview and stack those scrollviews vertically in linear layout, then you'll have separate scrollbar for each textview.

How to make my layout with custom view scrollable? When I make a scroll view my root node, in stead of relativelayout, my view is not showing

Somehow my view just dissapears when I put the scrollview as the root node..
how to resolve this, I don't hvae a clue why this happens.
This is my xml, this is with the scrollview.
With this scrollview my custom view doesn't show on the screen.
When i remove the scrollview it does. I really don't know how to resolve this..
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="#+id/dennisText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="hierstaatdanstrakseenstoerenewsfeedendatsoortshitditdatallesstoermooiboyvriendje"
android:textColor="#00FF00"/>
<TextView
android:id="#+id/textView0"
android:layout_below="#+id/dennisText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="TextView" />"
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/textView0"
android:layout_marginLeft="20dp"
android:layout_toRightOf="#+id/textView0"
android:text="TextView" />
<Spinner
android:id="#+id/Spinner1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/textView1"
android:layout_toRightOf="#+id/textView1"
android:drawSelectorOnTop="true"
android:prompt="#string/prompt2"
/>
<Spinner
android:id="#+id/Spinner2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/Spinner1"
android:layout_alignParentRight="true"
android:layout_below="#+id/Spinner1"
android:drawSelectorOnTop="true"
android:prompt="#string/prompt2" />
<View
android:id="#+id/view1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/drawView2"
android:layout_alignRight="#+id/drawView2" />
<com.TerraMare.DrawView2
android:id="#+id/drawView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="#+id/Spinner2"
android:layout_marginBottom="38dp"
android:layout_marginRight="40dp" />
<Spinner
android:id="#+id/Spinner3"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/drawView2"
android:maxWidth="150dp" />
<Button
android:id="#+id/draw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/Spinner3"
android:layout_alignParentRight="true"
android:layout_below="#+id/Spinner3"
android:onClick="drawgraph"
android:text="Teken Grafiek" />
</RelativeLayout>
</ScrollView>

Categories

Resources