码迷,mamicode.com
首页 >  
搜索关键字:findviewbyid    ( 816个结果
onItemLongClick事件的监听
首先需要implements1 public class MainActivity extends AppCompatActivity implements OnItemLongClickListener再绑定1 ListView listView = (ListView)findViewById....
分类:其他好文   时间:2015-10-11 22:48:03    阅读次数:177
spinner
spinner下拉菜单首先要有一个字符数组 长春 大连 北京 上海 然后在xml文件里加入这个控件这是一种方法还有一种方法是通过activity主要代码sp = (Spinner) findViewById(R.id.city);sp.setPrompt("请选择你喜欢的城市"); 这里可以直接写....
分类:其他好文   时间:2015-10-09 12:07:55    阅读次数:205
LayoutInflater类详解
http://www.cnblogs.com/top5/archive/2012/05/04/2482328.html在实际开发中LayoutInflater这个类还是非常有用的,它的作用类似于 findViewById()。不同点是LayoutInflater是用来找res/layout/下的xm...
分类:其他好文   时间:2015-10-06 22:03:07    阅读次数:166
[转]Fragment跳转至Activity或者Fragment
1.Fragment跳转至Activity从fragment中跳转和从activity中跳转类似,只不过你要先通过fragment的getActivity方法获取到显示这个fragment的activity,具体代码是这样的:Buttonbutton=view.findViewById(xxx);b...
分类:其他好文   时间:2015-10-05 20:40:55    阅读次数:233
百度地图根据位置显示地图
mMapView = (MapView) findViewById(R.id.bmapView); mBaiduMap = mMapView.getMap(); LatLng ll = new LatLng(36.000000,120.000000)...
分类:其他好文   时间:2015-10-01 22:59:13    阅读次数:240
android TextView不用ScrollViewe也可以滚动的方法
TextView textview = (TextView) findViewById(R.id.text); /** * * 只有调用了该方法,TextView才能不依赖于ScrollView而实现滚动的效果。 ...
分类:移动开发   时间:2015-10-01 16:22:05    阅读次数:209
Android ImageView 图片设置为透明
方法一:在xml中,设置如下java代码中privateImageView image;image = (ImageView) findViewById(R.id.xx_id);image.getBackground().setAlpha(0);方法二:在xml中,设置如下java代码中privat...
分类:移动开发   时间:2015-09-28 20:48:58    阅读次数:183
Android常见尺寸的获取
代码: //获取控件尺寸(控件尺寸只有在事件里面可以获取到) TextView mTV = (TextView) findViewById(R.id.iv_view); int width = mTV.getWidth(); int height = mTV.getHeigh...
分类:移动开发   时间:2015-09-28 19:04:27    阅读次数:233
万能适配器的打造!
一、分析1通用Viewhold类:(1)利用一个容器SparseArray将View进行封装(2)提供Viewhold方法,new一个convertview; 提供Viewhold get方法,实现converview的复用; 提供getView方法,实现控件的findviewbyid ...
分类:其他好文   时间:2015-09-27 12:31:41    阅读次数:171
【Android】九宫格实现
第一步,布局文件 第二步,在你的activity 中调用初始化GridGridView gridview = (GridView) findViewById(R.id.GridView); ArrayList> meumList = new ArrayList>(); for (...
分类:移动开发   时间:2015-09-27 10:02:12    阅读次数:159
816条   上一页 1 ... 31 32 33 34 35 ... 82 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!