ScrollView

来源:互联网 发布:如何制作淘宝图片 编辑:程序博客网 时间:2024/06/11 22:17

activity_main.xml

<?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:id="@+id/activity_main"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:padding="10dp"    tools:context="com.example.android.scrollviewdemo.MainActivity">    <LinearLayout        android:layout_width="match_parent"        android:layout_height="match_parent"        android:orientation="vertical">        <ImageView            android:id="@+id/imageView"            android:layout_width="wrap_content"            android:layout_height="200dp"            android:scaleType="centerCrop"            android:src="@drawable/kebe"/>        <Button            android:id="@+id/button"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:text="Know more"/>        <TextView            android:id="@+id/titleTextView"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="@string/title"            android:textAppearance="?android:attr/textAppearanceLarge"/>        <TextView            android:id="@+id/contentTextView"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="@string/content"            android:textAppearance="?android:attr/textAppearanceSmall"/>    </LinearLayout></ScrollView>

ScrollViewExampleImage

http://stacktips.com/tutorials/android/android-scrollview-example具体看这儿
原创粉丝点击