4

I'm following this solution to create transparent status bar

The problem is now i have a ScrollView which is not working if i opened the keyboard.

If i remove this line it works fine but i loose the transparent status bar feature.

w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

Any idea why this is happening and how to solve it ?

This my layout xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:fitsSystemWindows="true"

    tools:context="com.paytabs.merchant.paytabsmerchant.Activities.RegisterOneActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:title="Create Your Account"
        android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/r1toolbar"
        android:layout_width="match_parent"
        android:paddingTop="10dp"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        />
    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_register_one" />


</LinearLayout>

And this is what is inside content_register (Minimal Code, my controls inside this linear layout)

<ScrollView
    android:fillViewport="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbars="vertical"
    android:isScrollContainer="false"
    xmlns:android="http://schemas.android.com/apk/res/android">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="50dp"
    android:paddingTop="10dp"
    android:paddingRight="20dp"
    android:paddingLeft="20dp"
    tools:context="com.paytabs.merchant.paytabsmerchant.Activities.RegisterOneActivity"
    tools:showIn="@layout/activity_register_one">
</LinearLayout>
</ScrollView>
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Samy Massoud
  • 4,295
  • 2
  • 35
  • 48
  • Try this **`getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);`** but it works above marshmallow – Ratilal Chopda Nov 07 '17 at 10:20
  • @RatilalChopda i have tried it but the status bar still there – Samy Massoud Nov 07 '17 at 10:23
  • You should probably post more information. What does your layout look like for example? – se_bastiaan Nov 07 '17 at 10:27
  • @se_bastiaan please check the update – Samy Massoud Nov 07 '17 at 10:32
  • I also have this issue. Scrollview normally works, except I added this to my activity class. Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); I did this because my project requires a header background that is a smooth gradient all throughout so this made it work, except that it broke scrollviews. It's just like the adjustResize flag doesn't work at all when it's translucent. – greatergoodguy Jun 14 '18 at 15:43
  • Did you find any solution? – Md Azharuddin May 03 '21 at 06:51

0 Answers0