zoukankan      html  css  js  c++  java
  • demo03linearlayoutdemo;

    package com.example.demo03linearlayoutdemo;
    
    import android.os.Bundle;
    import android.app.Activity;
    import android.view.Menu;
    import android.view.ViewGroup;
    import android.widget.LinearLayout;
    import android.widget.TextView;
    
    public class MainActivity extends Activity {
        //编程实现LinearLayout
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
    //        LinearLayout linearLayout = new LinearLayout(this);
    //        //quick key alt+cmd+v
    //        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
    //
    //
    //
    //        layoutParams.setLayoutDirection(LinearLayout.VERTICAL);
    //
    //        LinearLayout.LayoutParams txtParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    //        TextView textView = new TextView(this);
    //        textView.setLayoutParams(txtParams);
    //        textView.setText("wwww.baidu.com");
    //        textView.setTextSize(20);
    //
    //        linearLayout.addView(textView,txtParams);
    //        super.addContentView(linearLayout,layoutParams);
            
            
            
        }
    
    
        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            // Inflate the menu; this adds items to the action bar if it is present.
            getMenuInflater().inflate(R.menu.main, menu);
            return true;
        }
        
    }
  • 相关阅读:
    Bootstrap3 代码-代码块
    DB2 911错误的解释
    Bootstrap3 代码-用户输入
    Bootstrap3 代码-内联代码
    Bootstrap3 排版-列表
    Bootstrap3 排版-引用
    Bootstrap3 排版-地址
    Bootstrap3 排版-缩略语
    Bootstrap3 排版-改变大小写
    Bootstrap3 排版-对齐
  • 原文地址:https://www.cnblogs.com/alamps/p/5211508.html
Copyright © 2011-2022 走看看