Created
October 29, 2013 06:18
-
-
Save xxxzhi/7209875 to your computer and use it in GitHub Desktop.
turn the view to bitmap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
linear.setDrawingCacheEnabled(true); | |
//you could not use this. | |
//linear.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), | |
// MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); | |
//linear.layout(0, 0, linear.getMeasuredWidth(), linear.getMeasuredHeight()); | |
linear.buildDrawingCache(); | |
//获取显示的内容当成图片来显示。 | |
iv.setImageBitmap(linear.getDrawingCache()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment