gpt4 book ai didi

android - 尝试为 https ://github. com/appsthatmatter/GraphView 拍摄图形快照时获取 IllegalStateException

转载 作者:搜寻专家 更新时间:2023-11-01 09:37:33 25 4
gpt4 key购买 nike

我正在尝试拍摄 GraphView 的快照,但出现错误“GraphView 必须在硬件加速模式下使用。”我正在使用以下代码拍摄快照

Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); 
Canvas canvas = new Canvas(bitmap);
view.draw(canvas);

此外,我已经在应用程序级别设置了 android:hardwareAccelerated="true"

最佳答案

我用过这个:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile files('libs/GraphView-4.0.1.jar')
compile 'com.jjoe64:graphview:4.1.0'
}

特别是

compile 'com.jjoe64:graphview:4.1.0'

这对我有帮助。

关于android - 尝试为 https ://github. com/appsthatmatter/GraphView 拍摄图形快照时获取 IllegalStateException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41920458/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com