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;的更多相关文章
随机推荐
- ThreadPoolExecutor 分析
一.从用法入手 Creates a thread pool that creates new threads as needed, but will reuse previously construc ...
- C++内存问题大集合(指针问题,以及字符串拷贝问题,确实挺危险的)
作者:rendao.org,版权声明,转载必须征得同意. 内存越界,变量被篡改 memset时长度参数超出了数组长度,但memset当时并不会报错,而是操作了不应该操作的内存,导致变量被无端篡改 还可 ...
- IOS 手势事件的冲突
关于手操作需要强调几点: UIImageView默认是不支持交互的,也就是userInteractionEnabled=NO ,因此要接收触摸事件(手势识别),必须设置userInteractionE ...
- SqlServer2008R2安装步骤
参考http://jimshu.blog.51cto.com/3171847/585023/
- Swift-10--错误处理
如何优雅地抛出错误-- 抛出错误使用throw关键字. 某个错误被抛出时,那个地方的某部分代码必要要负责处理这个错误,比如纠正这个问题.尝试另外一种方式.或是给用户提示这个错误. ***4种处理错误的 ...
- imx6 KEY_ROW4 power output high fail
imx6 KEY_ROW4的pin设置成gpio之后,不能够输出高电平.解决方法记录于此. 参考链接: https://lists.yoctoproject.org/pipermail/meta-fr ...
- In App Purchase Statuses
In App Purchase StatusesThe following are the available states that can be assigned to your in app p ...
- objective-c 中随机数的用法 3种:arc4random() 、random()、CCRANDOM_0_1()
oc 中随机数的用法(arc4random() .random().CCRANDOM_0_1() 1).arc4random() 比较精确不需要生成随即种子 使用方法 : 通过arc4random() ...
- jQuery重置form表单的方法
1 $("#formChangePwd")[0].reset();//清空表单元素的值 2 或直接用javascript代码操作 http://www.jb51.net/art ...
- Java List操作
一.List:.有顺序以线性方式存储,可以存放重复对象 线程安全方法:List list = Collections.synchronizedList(new LinkedList(...)); ...