android:orinetation not working

0 mayank jain · January 30, 2015
I watched first 10 tutorial and tried to code a little...i used android:orientation="vertical" but it didn't work..can someone point out the mistake!!

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.myfirstapp.Startingpoint" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />
    
      <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="check" />

</RelativeLayout>


both textview coincided but acc to the logic the second one should below the first one!!

Post a Reply

Replies

Oldest  Newest  Rating
0 Milan Obrenovic · January 31, 2015
Relative layout cannot have orientation (or can it?)

If you want to use orientation, change the tag into LinearLayout.
  • 1

Java / Android Development

106,915 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator