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;
        }
        
    }
  • 相关阅读:
    关于背包DP的几点总结
    C++ P1510 精卫填海
    C++ P1060 开心的金明
    C++ P2613 【模板】有理数取余
    C++ P3811 【模板】乘法逆元
    C++ P1865 A % B Problem
    【转】char码值对应列表大全
    JDK和JVM
    如何打包成jar包自己看呢?
    java的真相
  • 原文地址:https://www.cnblogs.com/alamps/p/5211508.html
Copyright © 2011-2022 走看看