2

I am facing issue in 540*960 devices that in bottom of the phone it showing one black panel.. how can i remove it.. The device is LAVA Xolo which having resolution of 540*960.. Any suggestion ? Here is the screenshot of the phone enter image description here

Thank in advance..

4

1 回答 1

1

没有办法完全摆脱系统栏,但是从 API 级别 11 开始,您可以使用setSystemUiVisibillitycall 来隐藏系统栏。执行此操作时,默认情况下会隐藏该栏,但当用户沿屏幕下边缘触摸时会显示该栏。您的代码将如下所示:

View screen = findViewById(R.id.main_activity_layout);
screen.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);

然后,您可以注册一个侦听器以在用户沿屏幕底部边缘触摸并且系统栏显示/隐藏时执行某些操作,如下所示:

screen.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener () {
    @Override
    public void onSystemUiVisibilityChange(int visibility) {
        if ((visibility == View.SYSTEM_UI_FLAG_VISIBLE)) {
            //User touched the screen and the bar is shown
            //do what you need in that case
        } else {
            //Touch event "expired" and the bar is hidden again
            //do what you need in this case
        }
    }
});

请注意,您必须在您的 android 清单中指定目标 SDK,此代码才能正常工作。并且最低版本必须至少为 11:

<uses-sdk android:minSdkVersion="11"
          android:targetSdkVersion="at_least_11"
          android:maxSdkVersion="at_least_targetSdkVersion" />
于 2013-05-15T08:02:27.787 回答