Reputation: 4255
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
Thank in advance..
Upvotes: 2
Views: 271
Reputation: 57316
There is no way to complete get rid of the system bar, however starting with API level 11, you can use setSystemUiVisibillity
call to hide the system bar. When you do this, the bar is hidden by default but then shown when the user touches along the lower edge of the screen. Your code would look something like this:
View screen = findViewById(R.id.main_activity_layout);
screen.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
You can then register a listener to do something when the user touches along the bottom edge of the screen and the system bar is shown/hidden, somethin glike this:
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
}
}
});
Note that you must specify the target SDK in your android manifest for this code to work. And the minimum version must be at least 11:
<uses-sdk android:minSdkVersion="11"
android:targetSdkVersion="at_least_11"
android:maxSdkVersion="at_least_targetSdkVersion" />
Upvotes: 1