Android change google map padding at runtime

前端 未结 1 1652
醉梦人生
醉梦人生 2020-12-16 15:14

I want to move Google map layout items at runtime, but I\'m not able to do it and I don\'t know if it\'s possible or not. What I want to do is: I have a Google map fragment

相关标签:
1条回答
  • 2020-12-16 15:42

    As long as the layout process is not finished, the view's dimension is set to 0. Using Handler, you can set the map's padding after the layout is done.

        new Handler().post(new Runnable() {
            @Override
            public void run() {
                mapHelper.map.setPadding(0,0,0,ad.getHeight());
            }
        });
    
    0 讨论(0)
提交回复
热议问题