Coder Social home page Coder Social logo

Comments (22)

laobie avatar laobie commented on May 27, 2024

输入框这个应该需要你设置下相关的属性吧,这个和设置状态栏应该没关系的,不知道你现在解决了没

from statusbarutil.

ailiboy520 avatar ailiboy520 commented on May 27, 2024

今天我也遇到这个问题 在清单文件设置 android:windowSoftInputMode="adjustResize|stateHidden"
后点击输入框,没有跟随,去掉这个状态栏后显示就可以的
具体布局是这样的



    <ImageView
        android:id="@+id/login_bg"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="fitXY"
        android:src="@mipmap/bg_login"
        />
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:orientation="vertical"
        >
        <ImageView
            android:layout_width="200dp"
            android:layout_height="50dp"
            android:scaleType="fitXY"
            android:src="@mipmap/image_water_mark"
            />
    </LinearLayout>

</RelativeLayout>

<TextView
    android:id="@+id/login_center"
    android:layout_width="match_parent"
    android:layout_height="1px"
    android:layout_centerInParent="true"
    />
<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/login_center"
    android:scrollbars="none"
    >
    <LinearLayout
        android:id="@+id/login_edit_contanter"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginBottom="@dimen/edit_bottom_margin"
        android:paddingLeft="@dimen/common_left_padding"
        android:paddingRight="@dimen/common_right_padding"
        >
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/common_left_margin"
            android:layout_marginRight="@dimen/common_right_margin"
            android:orientation="horizontal"
            >
            <TextView
                android:layout_width="85dp"
                android:layout_height="@dimen/input_box_height"
                android:paddingLeft="@dimen/edit_left_padding"
                android:text="@string/account"
                android:gravity="center|left"
                style="@style/input_login_box_style"
                />
            <EditText
                android:id="@+id/et_account"
                android:layout_width="match_parent"
                android:layout_height="@dimen/input_box_height"
                android:background="@color/transparent"
                android:layout_marginLeft="20dp"
                android:digits="@string/user_name_valid_char"
                android:singleLine="true"
                style="@style/input_login_box_style" />

        </LinearLayout>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:background="@color/login_text_cseparate_color"
            />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/common_left_margin"
            android:layout_marginRight="@dimen/common_right_margin"
            android:orientation="horizontal"
            >
            <TextView
                android:layout_width="85dp"
                android:layout_height="@dimen/input_box_height"
                android:paddingLeft="@dimen/edit_left_padding"
                android:text="@string/password"
                android:gravity="center|left"
                style="@style/input_login_box_style"
                />
            <EditText
                android:id="@+id/et_password"
                android:layout_width="match_parent"
                android:layout_height="@dimen/input_box_height"
                android:background="@color/transparent"
                android:layout_marginLeft="20dp"
                android:singleLine="true"
                android:inputType="textPassword"
                style="@style/input_login_box_style"
                />

        </LinearLayout>


        <TextView
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:background="@color/login_text_cseparate_color"
            />


        <Button
            android:id="@+id/btn_login"
            android:layout_width="match_parent"
            android:layout_height="@dimen/common_btn_height"
            android:layout_marginTop="@dimen/btn_top_margin"
            android:layout_marginLeft="@dimen/common_left_margin"
            android:layout_marginRight="@dimen/common_right_margin"
            android:text="@string/login"
            android:textColor="@color/login_btn_text_color"
            android:background="@drawable/selector_button"
            style="@style/unify_button_style" />

        <TextView
            android:id="@+id/tv_login_forget"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:layout_marginBottom="20dp"
            android:textColor="@color/login_text_forget_color"
            android:textSize="@dimen/common_text_size"
            android:text="@string/forget"
            android:layout_gravity="center_horizontal"
            />
    </LinearLayout>
</ScrollView>

from statusbarutil.

tanweijiu avatar tanweijiu commented on May 27, 2024

这个跟透明状态栏有关,你的设备是5.0以后的版本么?

from statusbarutil.

beanu avatar beanu commented on May 27, 2024

有同样的问题,使用 StatusBarUtil.setTransparentForImageView(this, rlHeader);之后 软键盘不弹出,去掉之后 就可以了。5.0以上系统

from statusbarutil.

beanu avatar beanu commented on May 27, 2024

状态栏透明会影响软键盘的弹出,应该是系统的问题,不是StatusBarUtil的问题。临时解决方案是用了 StatusBarUtil.setColor

from statusbarutil.

ShaunWilson avatar ShaunWilson commented on May 27, 2024

我也遇到了同样的问题,给键盘的enter键设置成搜索失效了

from statusbarutil.

LingChenJie avatar LingChenJie commented on May 27, 2024

我也遇到了,在小米手机上,如果设置状态栏透明度,就会出现软键盘把EditText给遮住。

from statusbarutil.

laobie avatar laobie commented on May 27, 2024

😔

from statusbarutil.

wangshaolei avatar wangshaolei commented on May 27, 2024

@laobie 这个问题最佳兼容实践有人实验过没有

from statusbarutil.

tanweijiu avatar tanweijiu commented on May 27, 2024

问题是出在,addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS),这个flag,是会影响键盘的,键盘弹出布局自动适配这个效果是会受到多种因素影响的,比如全屏或者....(建议看看相关的资料)

from statusbarutil.

wangshaolei avatar wangshaolei commented on May 27, 2024

@tanweijiu thanks~ 有解决方案分享一下,一起看一下。

from statusbarutil.

tanweijiu avatar tanweijiu commented on May 27, 2024

@wangshaolei http://stackoverflow.com/questions/21092888/windowsoftinputmode-adjustresize-not-working-with-translucent-action-navbar/22266717#22266717 可以看看这个

from statusbarutil.

wangshaolei avatar wangshaolei commented on May 27, 2024

@tanweijiu 这里面两个方法试过了,没起作用。还有我是配合https://blog.dreamtobe.cn/2015/09/01/keyboard-panel-switch/
这个使用StatusBarUtil的

from statusbarutil.

laobie avatar laobie commented on May 27, 2024

@wangshaolei 透明会影响?setColor 会出现问题不

from statusbarutil.

wangshaolei avatar wangshaolei commented on May 27, 2024

@laobie setColor不会出现问题。是FLAG_TRANSLUCENT_STATUS这个影响的,我也是昨天晚上发现的。

from statusbarutil.

wangshaolei avatar wangshaolei commented on May 27, 2024

@OverRide
public final WindowInsets onApplyWindowInsets(WindowInsets insets) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
return super.onApplyWindowInsets(insets.replaceSystemWindowInsets(0, 0, 0, insets.getSystemWindowInsetBottom()));
} else {
return insets;
}
}
重写这个adJustResize 虽然有变化了,但是键盘的显示事件监听不到了。很纠结。@tanweiju

from statusbarutil.

tanweijiu avatar tanweijiu commented on May 27, 2024

@wangshaolei https://code.google.com/p/android/issues/detail?id=5497 然后你可以搜索一个工具类(AndroidBugSolutionAboutInputMethod.java)...

from statusbarutil.

wangshaolei avatar wangshaolei commented on May 27, 2024

@tanweijiu 没有搜到呢,有没有地址?thanks

from statusbarutil.

wangshaolei avatar wangshaolei commented on May 27, 2024

@tanweijiu 有没有很好解决方法呢,请教一下,你说的这个地址 貌似没有找到相关信息,谢谢~

from statusbarutil.

shlockfan avatar shlockfan commented on May 27, 2024

如果是透明状态栏,把布局改成relativeLayout,然后想要顶起的布局放到bottom,就能顶起来了,你们可以试下,我以前遇到过。

from statusbarutil.

ruanbaojun1105 avatar ruanbaojun1105 commented on May 27, 2024

同遇到 所以就没用透明了 好坑

from statusbarutil.

laobie avatar laobie commented on May 27, 2024

image

from statusbarutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.