zoukankan      html  css  js  c++  java
  • android 聊天室窗体

    public class MainActivity extends Activity {
    	 ScrollView scrollView;
    	  Button button;
    	  LinearLayout layout;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
           
        //    File f=new File("");
            scrollView=(ScrollView)findViewById(R.id.scrollView1);
         //   scrollView.fullScroll(ScrollView.FOCUS_DOWN);
            button=(Button)findViewById(R.id.button1);
            layout=(LinearLayout)findViewById(R.id.linear);
            button.setOnClickListener(new OnClickListener() {
    			
    			@Override
    			public void onClick(View arg0) {
    				// TODO Auto-generated method stub
    				TextView textView=new TextView(MainActivity.this);
    				textView.setId(1);
    				textView.setText("1");
    				layout.addView(textView);
    				scrollView.fullScroll(ScrollView.FOCUS_DOWN);
    			}
    		});
        }
    

  • 相关阅读:
    js对象
    实习经历日志02
    前端实习经历日志01
    js变量提升
    WebApls-元素(offset, client, scroll)
    WebApls-Bom
    WebApls-DOM的核心总结
    WebApls-节点01
    javascript-
    Javascript-字符串对象
  • 原文地址:https://www.cnblogs.com/liguangsunls/p/7117891.html
Copyright © 2011-2022 走看看