工作中的问题
jiaqiangziji
踏着青春的脚步,迎着未来的风向。
展开
-
在 xml 设置的 onClick 属性 为什么有时候点击不起作用呢?
在 xml 文件中“显示指定按钮的onClick属性,这样点击按钮时会利用反射的方式调用对应Activity中的click()方法” //activity.findViewById方法进行映射的。 这里由于用到了反射所以我们在项目中要不适用这个属性来设置点击事件。原创 2016-04-15 17:28:28 · 733 阅读 · 2 评论 -
使用 recyclerView 布局显示不合理的问题
在项目中 RecyclerView 替代了 listVeiw 和 GridView ,但是在使用过程难免不出现问题。比如 itmen 的布局文件 width 使用 match_parent ; 这个属性的时候却出现了显示 warp_content 现象,也就是包裹内容,但是在预览界面就是显示正常的。解决方法: @Override public MyViewHolder onCreateVi原创 2016-05-30 10:04:51 · 718 阅读 · 0 评论 -
把 view 转换成bitmap对象
View mViewInflater = LayoutInflater.from(this).inflate(R.layout.item_gallery, null); ImageView mGalleryImage = (ImageView) mViewInflater.findViewById(R.id.gallery_image); mGalle原创 2016-06-06 21:06:40 · 1591 阅读 · 0 评论 -
关于图片使用缩放不起作用这是就需要使用 Matrix
if (mSelectPostion == position) {// Bitmap bitmap = ((BitmapDrawable)iv.getDrawable()).getBitmap(); Matrix matrix = new Matrix(); matrix.setScale(1.2f, 1.2f);原创 2016-06-06 21:07:58 · 840 阅读 · 0 评论 -
viewpager不返回最大值实现轮播
private boolean isAutoPlay = false; private long currentTime; @Override public void onPageScrollStateChanged(int state) { ViewPagerS#CROLL_STATE_IDLE * @see原创 2016-06-06 21:10:14 · 305 阅读 · 0 评论 -
android 获取手机通讯录以及 6.0 授权
获取手机通讯录获取手机通讯录需要使用到 ContentProvider 的观察者 ContentResolver 来获取。` //获取手机通讯录联系人 ContentResolver resolver = this.getContentResolver(); // 获取手机联系人 Cursor phoneCursor = resolver.query(ContactsContr原创 2016-06-14 16:26:03 · 12119 阅读 · 2 评论