码迷,mamicode.com
首页 >  
搜索关键字:findviewbyid    ( 816个结果
关于Bundle传递消息
定义引用三个组件EditText name = (EditText)findViewById(R.id.name);EditText passwd = (EditText)findViewById(R.id.passwd);RadioButton male = (RadioButton) findV...
分类:其他好文   时间:2015-09-26 23:59:48    阅读次数:389
ButterKnife--View注入框架
俗话说:“不会偷懒的程序员不是好的程序员!”。作为一名Android开发,是不是经常厌烦了大量的findViewById以及setOnClickListener代码,而ButterKnife是一个专注于Android系统的View注入框架,让你从此从这些烦人臃肿的代码中解脱出来。先来看一段代码示例说...
分类:其他好文   时间:2015-09-23 16:53:24    阅读次数:204
View的setOnClickListener的添加方法
1)最常见的Button btn = (Button) findViewById(R.id.myButton);btn.setOnclickListener(new View.OnClickListener(){ public void onClick(View v) { ...
分类:其他好文   时间:2015-09-23 16:20:11    阅读次数:206
Android Activity学习
1、在一个Activity中启动另外一个Activity(显示Intent使用) Button?button?=?(Button)?findViewById(R.id.startActivity); button.setOnClickListener(new?View.OnClickListener()?{ ????@Override ?...
分类:移动开发   时间:2015-09-22 19:14:40    阅读次数:152
Android Intent实现页面跳转
Intent可以来协助完成Android各个组件之间的通信1:startActivity(intent); //直接启动 /* * 通过监听点击事件跳转套第二个activity */ button=(Button) findViewById(R.id. button1); button....
分类:移动开发   时间:2015-09-22 18:16:43    阅读次数:155
TextView下划线,部分文字并响应点击事件(SpannableString)
TextView useInfo = (TextView) findViewById(R.id.info); useInfo.setText("开始即表示您同意遵守"); String url_0_text = "用户协议及隐私条款"; Sp...
分类:其他好文   时间:2015-09-17 14:52:03    阅读次数:121
android 百度地图 通过剪裁图片添加 Marker
初始化百度地图:1 private void initViews() {2 4 mMapView = (MapView) findViewById(R.id.bmapView);5 mBaiduMap = mMapView.getMap();6 // ...
分类:移动开发   时间:2015-09-16 19:32:53    阅读次数:186
案例:SeekBar的滑块上面带有另外的视图可以跟着一起滚动
效果图:XML布局: JAVA代码: SeekBar sb=(SeekBar) popupWindow.findViewById(R.id.sb); final TextView sb_text=(TextView) popupWindow.findViewById(R.id.sb_text); s...
分类:其他好文   时间:2015-09-16 12:42:10    阅读次数:248
android textView 替文字添加下划线 删除线
android textView 为文字添加下划线 删除线android textview 添加下划线 中划线 删除线tv=(TextView)findViewById(R.id.tvId);tv.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG); /...
分类:移动开发   时间:2015-09-15 14:22:39    阅读次数:234
Android double输出时保留两位小数
方法1,在代码中操作this.totalTextview = (TextView) findViewById(R.id.package_total_money); double decimalBalance = Math.round((balance/10f))/100f; DecimalF...
分类:移动开发   时间:2015-09-15 10:36:36    阅读次数:155
816条   上一页 1 ... 32 33 34 35 36 ... 82 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!