以一个截图,但显示为0 KB文件中的android? [英] Taking a screenshot but shows 0 KB file in android?
本文介绍了以一个截图,但显示为0 KB文件中的android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不得不采取了以后可以保存在SD卡上的截图。我已经通过在下面给出链接的code消失了。
I had to take a screenshot that can be later saved in SD card. I have gone through the code given at below this link.
通过code 的Android抓图
Android take screenshot via code
的问题是,它会在我的SD卡零(0)kb的文件。可能是什么问题?什么是 id.layoutroot
?
problem is that it creates a zero(0) kb file in my Sd card. what could be the problem? and what is id.layoutroot
?
推荐答案
layoutroot是最有可能给根布局的ID在
layoutroot is most likely the id given to the root layout as in
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutroot"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
...
... (other ui items)
尝试用你想捕捉并检查绘图启用缓存视图的ID。
Try to use the id of the view you want to capture and check if the drawing cache is enabled.
这篇关于以一个截图,但显示为0 KB文件中的android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文