Android Transparent status bar

sapan
Recently I wanted to get a transparent status bar so that my app background blends smoothly with the status bar . Below method worked




#Method 1

below snippet in the onCreate() menu help me to make it transparent.
@Overrideprotected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);


    //make status bar transparent    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
 {
        Window w = getWindow();
        w.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
        w.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
    }



    setContentView(R.layout.activity_main);

}

Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !