density如何解读? 本帖最后由 HawkOfWinter 于 2012-05-29 07:15:50 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 hw.lcd.density=160 与图片尺寸是:320 * 273的宽,刚好2倍,是巧合吗? density是屏幕的密度,320*480的手机屏幕是标准的,drawBitmap是在画布上根据像素来画的,而且初始位置是x,y坐标来定,如果你的屏幕稍大, 右边就会留出空隙,所以很多布局都是用dp来控件控件的大小,dp是像素无关的, 如果drawBitmap是在画布上根据像素来画的,那么应该右边留空。结果没啊! sorry,是我错了,刚才又看了下函数说明If the bitmap and canvas have different densities, this function will take care of automatically scaling the bitmap to draw at the same density as the canvas.如果位图和画布的density不同,位图会自动伸缩来适应画布 你所谓的看了下图片尺寸是320x273,是指电脑上用画图软件打开看到的像素尺寸?还是说 bitmap.getWidth() == 320 getHeight()==273 ? 类似微信朋友圈评论功能 关于用setComponentEnabledSetting隐藏程序图标的问题 android平板电脑之间通过WiFi传递信息 一个按钮上的文字不居中显示的问题 BigDecimal问题 打android list targets 怎么什么也不显示 listView中带checkBox问题、 Android 如何 发送图片到webservice中 一个不能上网局域网内,一台设备设置wifi热点,android手机能搜索到这个wifi热点吗? 关于百度围栏的一些困惑 令人纠结的ExpandableListView的onChildClick事件无法跳转 音乐播放进度条问题
drawBitmap是在画布上根据像素来画的,而且初始位置是x,y坐标来定,如果你的屏幕稍大, 右边就会留出空隙,所以很多布局都是用dp来控件控件的大小,dp是像素无关的,
If the bitmap and canvas have different densities, this function will take care of automatically scaling the bitmap to draw at the same density as the canvas.如果位图和画布的density不同,位图会自动伸缩来适应画布