Wednesday, September 22, 2010

XML Layout for Android

Ques:

Is there a way to display a View, such as a TextView sideways using the XML layout file? I know you can rotate the view using code in an activity, but is there a way just to do it with layout?


here's the answer

android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_weight="5"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:text="sideways dummy text sideways dummy text sideways dummy text sideways dummy text sideways dummy text sideways dummy text sideways dummy text"
android:id="@+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content">


android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:text="Text Here"
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">



No comments:

Post a Comment