课程/Android/移动开发
快速实现不一样的移动拼图
-
-
心有独钟
2016-09-11
- 感觉你做起来就像做小学数学题一样→_→
-
0赞 · 0采集
-
-
qq_sinkman
2016-08-14
- 加载比例不满足3:5的大图,切成对应比例的长方形,而且不超出屏幕。point为获取到的屏幕宽高。<br>
int smallWidth = bigBm.getWidth() / 5;<br>
int smallHeight = bigBm.getHeight() / 3; <br>
float scale = (float)(point.x / 5) / smallWidth; //宽度按比例缩小到屏幕宽,对应高也要按这个比例缩放。<br>
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(point.x / 5 ,(int)(smallHeight*scale)); //宽缩放到屏幕的1/5,高根据宽的缩放比例来缩放。<br>
gridLayout.addView(smallImage[i][j],params);
-
0赞 · 0采集