【问题标题】:How to handle when screen was rotated with map?屏幕随地图旋转时如何处理?
【发布时间】:2014-07-23 16:14:46
【问题描述】:

首先我不想在屏幕旋转后完全重新加载地图,我阅读了this 并将android:configChanges="orientation|screenSize" 添加到我的清单文件中,但我想在屏幕旋转后更改缩放,我该怎么做是吗?

【问题讨论】:

    标签: android google-maps screen-rotation


    【解决方案1】:

    您还需要将此方法添加到您的活动中:

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        // TODO Auto-generated method stub
        super.onConfigurationChanged(newConfig);
        if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
    
        } else {
    
        }
    }
    

    然后在那里处理你想要的:D

    【讨论】:

    • 但是如果我在fragment中使用map怎么办?
    • 用这个方法改变地图的缩放比例
    猜你喜欢
    • 1970-01-01
    • 2021-11-16
    • 2012-10-04
    • 1970-01-01
    • 1970-01-01
    • 2011-02-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多