search

Home  >  Q&A  >  body text

android 如何把图片动态加载到布局文件制定位置?

如果我要实现一个像forest APP这个界面类似的功能。就是能动态把树木放在土地的适当位置,这个功能应该怎么做?求思路。。。谢谢
我自己尝试用一个relativeLayout作为土地界面,但是不知道怎么动态的把树木(imageview)加载到合适位置。

黄舟黄舟2838 days ago906

reply all(5)I'll reply

  • 黄舟

    黄舟2017-04-17 15:59:02

    I think the effect shown by the subject is not accomplished through layout. It may be manually drawn by a custom View, and considering the mask, the tree in front will cover the rear view. If it is used as a custom View, it will still be It's quite complicated. Even if it's not a custom View, it can only be drawn through other drawing engines, such as opengl, but it can never be done through layout.

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:59:02

    You'd better draw this thing manually, otherwise you have to consider the screen size and dynamic calculation.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 15:59:02

    You have to go through the layout, which is a bit troublesome, unless you use each square as a View, but I always feel that the execution efficiency...

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 15:59:02

    Is this a game? If so, it is best to do it through CoCo2d-x or the unity framework, which can achieve this effect very easily.
    It is basically impossible and inappropriate to use View to achieve this effect.

    reply
    0
  • 迷茫

    迷茫2017-04-17 15:59:02

    One is to implement it by customizing a ViewGroup, in which each

    reply
    0
  • Cancelreply