DecorView开发中,通常都是在onCreate()中调用setContentView(R.layout.custom_layout)来实现想要的页面布局。页面都是依附在窗口之上的,而DecorView即是窗口最顶层的视图。Android frameworks中,与窗口视图处理相关的类,主要是W...
分类:
移动开发 时间:
2015-05-06 10:27:13
阅读次数:
218
private TextView tv_init;@overrideprotected void onCreate(Bundle saveInstanceState){ supper.onCreate(saveInstanceState); setContentView(R.layout.activ...
分类:
其他好文 时间:
2015-05-03 18:44:36
阅读次数:
99
安卓自定义AlertDialog,原理很简单:
AlertDialog dialog = new AlertDialog.Builder(MainActivity.this).create();
dialog.show();
Window window = dialog.getWindow();
window.setContentView(R.layout.aler...
分类:
微信 时间:
2015-04-24 12:40:11
阅读次数:
291
PopupWindow popupWindow = new PopupWindow(this); popupWindow.setContentView(LayoutInflater.from(this).inflate(R.layout.activity_main, null)); popu...
步骤一:创建CustomEditTextActivity类packagecom.example;importandroid.app.Activity;importandroid.os.Bundle;publicclassCustomEditTextActivityextendsActivity{@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView..
分类:
其他好文 时间:
2015-04-23 00:33:29
阅读次数:
147
两个布局文件,一个main.xml,一个main2.xml,一个MActivity,在MActivity的onCreate()里设置的是setContentView(R.layout.main)。现在如果我想获得main2.xml里的一个按钮Button b = (Button)findViewBy...
分类:
其他好文 时间:
2015-04-22 20:19:55
阅读次数:
108
/*Android开发去除标题栏title其实非常简单,他有两种方法,一种是在代码中添加,另一种是在AndroidManifest.xml中添加:*/1、在代码中实现:在此方法setContentView(R.layout.main)之前加入:requestWindowFeature(Window....
分类:
移动开发 时间:
2015-04-22 13:48:13
阅读次数:
129
全屏在Activity的onCreate方法中的setContentView(myview)调用之前添加下面代码requestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏标题getWindow().setFlags(WindowManager.LayoutP...
分类:
移动开发 时间:
2015-04-22 13:18:00
阅读次数:
133
??
不使用AlertDialog
Dialog dialog = new Dialog(context);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(view);
//去黑边框
dialog.getWin...
分类:
其他好文 时间:
2015-04-17 11:21:46
阅读次数:
108
先介绍去掉标题栏的方法:第一种:也一般入门的时候经常使用的一种方法requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏注意这句一定要写在setContentView()方法的前面,不然会报错的第二种:在AndroidManifest.xml文件中...
分类:
移动开发 时间:
2015-04-17 11:07:46
阅读次数:
145