首页 > 移动平台 > 详细

android 中ScrollView的使用

时间:2014-09-08 02:11:56      阅读:294      评论:0      收藏:0      [点我收藏+]

android中布局一般都有两种方式,一种xml声明,另外一种则是程序声明:

xml:

bubuko.com,布布扣
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
  
    <ScrollView 
        android:id="@+id/Scroll"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
        <TextView 
            android:id="@+id/txt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            />
    </ScrollView>
     


</LinearLayout>
bubuko.com,布布扣


手动代码声明:

TextView txt=new TextView(this);
        txt.setText(str);
        ScrollView scrollView = new ScrollView(this);
        scrollView.addView(txt);
        setContentView(scrollView);

android 中ScrollView的使用

原文:http://blog.csdn.net/tw19811220/article/details/39127433

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!