开发者

How do I add scrolling to an Android layout?

开发者 https://www.devze.com 2023-01-17 01:01 出处:网络
My code for the Layout is given below. I am not able see the full content, nor am I able to scroll. How can I show the entire contents by scrolling?

My code for the Layout is given below. I am not able see the full content, nor am I able to scroll. How can I show the entire contents by scrolling?

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content" android:paddingTop="10px" android:background="@color/bg_color" >
  <TextView android:paddingLeft="20px" android:text="hhhhhhhhhhhhhhhhh" android:id="@+id/eventname" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:textColor="@color/black" android:textStyle="bold" android:textSize="15px"></TextView>

</LinearLayout>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:paddingLeft="50px" android:layout_height="wrap_content" android:orientation="horizontal" android:background="@color/bg_color" android:layout_gravity="center_horizontal">

<ImageView android:id="@+id/ImageView01" android:scaleType="fitCenter" android:layout_width="100dip" android:layout_height="120dip" ></ImageView>
<ImageView android:id="@+id/ImageView02" android:scaleType="fitCenter" android:layout_width="100dip" android:layout_height="120dip" ></ImageView>
</LinearLayout>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content" android:orientation="vertical" android:background="@color/bg_color">
  <TextView android:paddingLeft="20px" android:text="" android:id="@+id/maindet" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView>
  <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Muzieikstijlen" android:id="@+id/stylet" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView>
  <TextView android:paddingLeft="20px" android:text="" android:id="@+id/styletype" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView>
  <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Prinjzen" android:id="@+id/prijzen" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView>
  <TextView android:paddingLeft="20px" android:text="" android:id="@+id/voor" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView>
  <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Line-up" android:id="@+id/lineup" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView>
  <TextView android:paddingLeft="20px" android:text="" android:id="@+id/djlist" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView>
  <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Minimumleeftijd" android:id="@+id/min" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView>
  <TextView android:paddingLeft="20px" android:text="" android:id="@+id/minage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/black" android:textSize="12px"></TextView>
</LinearLayout>
<Button android:id="@+id/back" android:layout_height="40px" android:layout_width="150px" android:layout_gravity="center" android:background="@co开发者_StackOverflow中文版lor/btnback" android:text="Back" android:textSize="20px" android:textColor="@color/bg_color"></Button>
</LinearLayout>

Screen shot of the phone:

Thank you.

How do I add scrolling to an Android layout?


Surround your layout with a ScrollView... (and I cant see any layout code you mentioned...)

0

精彩评论

暂无评论...
验证码 换一张
取 消