【问题标题】:how set a background image of the layout via Url in android? [duplicate]如何在android中通过Url设置布局的背景图像? [复制]
【发布时间】:2013-03-23 10:48:53
【问题描述】:

在我的应用程序中通过 JSON 从 web url 设置布局背景。但是在图像视图中我是这样设置的

try {
                  ImageView i = (ImageView)findViewById(R.id.animation);
                  Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL("http://alpharithm.in/manager/test/img/files/products/mushroom-soup.jpg").getContent());
                  i.setImageBitmap(bitmap); 
                } catch (MalformedURLException e) {
                  e.printStackTrace();
                } catch (IOException e) {
                  e.printStackTrace();
                }

不设置为背景。如何为布局设置背景?

【问题讨论】:

    标签: android android-layout android-imageview


    【解决方案1】:

    您可以从这里获得参考。

    Set Linear Layout Background

    希望这对你有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-03
      • 2012-06-01
      • 2012-01-19
      • 2017-10-16
      • 1970-01-01
      • 2019-03-24
      • 1970-01-01
      • 2013-11-16
      相关资源
      最近更新 更多