我没有使用Glide从网址获取图像

时间:2018-01-04 18:15:18

标签: java android try-catch android-glide

这是我试过的代码。 我没有使用Glide在bmp中获取图像,当我在将图像转换为byte []的方法中传递null bmp时,就会发生错误。
新的AsyncTask(){

if (@available(iOS 11.0, *)) {

    headerCell.insetsLayoutMarginsFromSafeArea = NO;
    headerCell.layoutMargins = UIEdgeInsetsMake(10, 0, 10, 0);
    UIEdgeInsets i = headerCell.layoutMargins;
    NSLog(@"Left: %f", i.left);
}

2 个答案:

答案 0 :(得分:0)

希望这适合你

x,y,z = np.moveaxis(arr, -1, 0)

答案 1 :(得分:0)

//这是我从URL获取图像的方式,即使滑动不能用于从URL保存图像。

try {
       URL url = new URL(url2img);//url2img is a String
       bmp =BitmapFactory.decodeStream(url.openConnection().getInputStream());
       //bmp is global variable  
}catch (IOException e)
    {e.printStackTrace();}
    byteimage1=getBytes(bmp);