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;
} }
demo03linearlayoutdemo;的更多相关文章
随机推荐
- WCF TCP 错误代码 10061: 由于目标计算机积极拒绝
表象是连不上服务端,本质原因多种多样,网络硬件问题导致的网络不通.服务本身问题或没有启动.或者防火墙阻隔等等不一而足. 1.ping看服务端能否ping通: 2.telnet ip地址 端口 ,看看是 ...
- readonly=“readonly”与readonly=“true”
<input id="u" readonly /> <input id="u" readonly="readonly" / ...
- 变态的HelloWorld
public static void main(String[] args) { int i, n[] = { (((1 << 1) << (1 << 1) < ...
- python笔记 - day8
python笔记 - day8 参考: http://www.cnblogs.com/wupeiqi/p/4766801.html http://www.cnblogs.com/wupeiqi/art ...
- git 入门 2
进入d盘,新建project文件, 右键,git bash here cd project 初始化 $ git init 克隆项目 $ git clone http://192.168.1.188:3 ...
- android UI进阶之用ViewPager实现欢迎引导页面
ViewPager需要android-support-v4.jar这个包的支持,来自google提供的一个附加包.大家搜下即可. ViewPager主要用来组织一组数据,并且通过左右滑动的方式来展示. ...
- Java集合 List,Set,Map
一.List:.有顺序以线性方式存储,可以存放重复对象 线程安全方法:List list = Collections.synchronizedList(new LinkedList(...)); ...
- 【转载】MFC 程序入口和执行流程
原文链接: http://www.cnblogs.com/liuweilinlin/archive/2012/08/16/2643272.html 一 MFC程序执行过程剖析 1)我们知道在WIN32 ...
- web文件上传的实现
1,html页面,上传使用input type=file控件,其所在的form必须加上enctype="multipart/form-data" <form role=&qu ...
- Install .NET Framework 4.5.2 on a Cloud Service Role
October Guest OS rollout is starting today October 15 2015, and projected to be released on November ...