android(11)(ScrollView的简单用法)
来源:互联网 发布:锐智餐饮软件 编辑:程序博客网 时间:2024/05/03 22:31
布局文件:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="onClick" android:text="添加" /> <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:id="@+id/ll" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > </LinearLayout> </ScrollView></LinearLayout>业务逻辑的实现:public class MainActivity extends Activity { private LinearLayout llGroup; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); llGroup = (LinearLayout) findViewById(R.id.ll); } public void onClick(View view) { // 添加一个TextView向llGroup // 定义一个textview对象 TextView tv = new TextView(this); tv.setText("张三 女 34"); // 把textview对象添加到linearlayout中 llGroup.addView(tv); }
0 0
- android(11)(ScrollView的简单用法)
- Android中ScrollView的用法
- Android下ScrollView的用法
- android scrollview 简单的使用
- ScrollView用法(一)
- ScrollView用法(一)
- ScrollView用法(一)
- ScrollView用法(一)
- ScrollView用法(一)
- ScrollView用法(一)
- android下拉刷新scrollview的用法pullToRefreshScrollview
- android TextView 带滚动条,和ScrollView 用法(暂时觉得ScrollView滑动速度比较快)
- Android SpannableString的简单用法(一)
- Android里回调(callback)的简单用法
- android的ScrollView的简单使用
- Android ScrollView用法
- Android ScrollView用法
- Android笔记(12)---ScrollView的使用
- STL简单学习
- NavigationBar图解
- 面向对象对现实世界的模拟
- Swift 格式化转换字符串
- MySQL存储引擎MyISAM与InnoDB的区别
- android(11)(ScrollView的简单用法)
- ASCII码表在线查询
- 技术小白教你如何做一个画蛋蛋的H5-涨粉神器-教你如何从1000到1W粉
- Android不同分辨率适配
- SlidingMenu源码分析
- 2015-12-4 微信公众号红包
- (六十三)第四章复习题
- Maven小知识一
- PC端&移动端的页面都用的到的CSS收藏(自己用的)