- 博客(4)
- 收藏
- 关注
转载 android:scaleType属性
ImageView.ScaleType.XXX|android:scaleType="xxx" 1. CENTER, "center" 居中显示。不缩放。不裁减。 2. CENTER_CROP, "centerCrop" 图片宽(高)小于ImageView的宽(高)时,按比例放大图片,使得图片宽(高)大于等于ImageView的宽(高)。居中显示。 3. CEN
2017-07-11 13:29:36
162
原创 将1位数字格式化为两位数字
java中提供了DecimalFormat类 java.text.DecimalFormat df=new java.text.DecimalFormat(); df.applyPattern("00"); df.format(要格式化的数字)
2017-07-06 09:39:43
1937
原创 在MainActivity中调用另外一个布局控件的方法
在编程过程中,遇到了一个问题,一直报: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.NumberPicker.setMaxValue(int)' on a null object reference 让我头痛。 经过网上查询: 对于非绑定的布局,是不能用fi
2017-07-05 15:41:37
4247
1
原创 android里CountDownTimer类的用法
CountDownTimer是安排一个计时器,随着时间的间隔,实现定期的通知。用这个来做倒计时类型的app,能够大大简化实现的过程。 构造方法: CountDownTimer(long millisInFuture, long countDownInterval): millisInFuture:表示倒计时的时间 countDownInterval:表示间隔的时间 方法:
2017-07-05 09:15:04
279
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅