zoukankan      html  css  js  c++  java
  • android ScrollView--Linearlayout可以上下拖动

    动态添加:
    [java] view plaincopy
    1. <?xml version="1.0" encoding="utf-8"?>    
    2. <ScrollView    
    3.     xmlns:android="http://schemas.android.com/apk/res/android"    
    4.     android:layout_width="fill_parent"    
    5.     android:layout_height="fill_parent"    
    6.     android:scrollbars="vertical"    
    7.     android:fadingEdge="vertical">    
    8.     <LinearLayout    
    9.         android:layout_width="fill_parent"    
    10.         android:layout_height="fill_parent"    
    11.         android:orientation="vertical"    
    12.         >    
    13.     </LinearLayout>    
    14. </ScrollView>    



    动态代码上:

    scrollView=new ScrollView(getApplicationContext());
    scrollView.setBackgroundColor(getResources().getColor(android.R.color.holo_blue_dark));
    scrollView.setScrollbarFadingEnabled(true);

    scrollview.addView(XXXX);

    值得一提的是XXX只能是一个总的控件或者一个子控件,如果直接添加两个子控件会报错。

  • 相关阅读:
    joins and includes
    学习库
    HTML5 画图--文字
    http://qiye.qianzhan.com/ 企业查询宝
    js 获取input选择的图片的信息
    input:file属性
    CSS 箭头
    颜色
    CSS 点击图片替换样式
    图片转base64
  • 原文地址:https://www.cnblogs.com/new0801/p/6175818.html
Copyright © 2011-2022 走看看