0

Please Check the Images

Image 1

Image 2 after one click

I want to hide and show all system bars (status bar, Action Bar and Bottom Navigation Bar) in every clicks on the activity screen.

4

1 回答 1

0

在第一次单击时设置 onClickListner,这将导致一个新活动,该活动仅显示具有黑色背景的图像(ImageView)。在新活动中确保它是全屏活动:

以编程方式:

public class ActivityName extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // remove title
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main);
       //Here display your image with an ImageView

       //Here set another onClickListner on the image or the background (the layout) that leads to the previous activity and finish() this one.
    }
}

或者在 AndroidManifest.xml

<activity android:name=".ActivityName"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>

如果是 AppCompatActivity

<activity android:name=".ActivityName"
    android:label="@string/app_name"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
于 2018-07-22T11:22:40.087 回答