Comments (22)
输入框这个应该需要你设置下相关的属性吧,这个和设置状态栏应该没关系的,不知道你现在解决了没
from statusbarutil.
今天我也遇到这个问题 在清单文件设置 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.
这个跟透明状态栏有关,你的设备是5.0以后的版本么?
from statusbarutil.
有同样的问题,使用 StatusBarUtil.setTransparentForImageView(this, rlHeader);之后 软键盘不弹出,去掉之后 就可以了。5.0以上系统
from statusbarutil.
状态栏透明会影响软键盘的弹出,应该是系统的问题,不是StatusBarUtil的问题。临时解决方案是用了 StatusBarUtil.setColor
from statusbarutil.
我也遇到了同样的问题,给键盘的enter键设置成搜索失效了
from statusbarutil.
我也遇到了,在小米手机上,如果设置状态栏透明度,就会出现软键盘把EditText给遮住。
from statusbarutil.
😔
from statusbarutil.
@laobie 这个问题最佳兼容实践有人实验过没有
from statusbarutil.
问题是出在,addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS),这个flag,是会影响键盘的,键盘弹出布局自动适配这个效果是会受到多种因素影响的,比如全屏或者....(建议看看相关的资料)
from statusbarutil.
@tanweijiu thanks~ 有解决方案分享一下,一起看一下。
from statusbarutil.
@wangshaolei http://stackoverflow.com/questions/21092888/windowsoftinputmode-adjustresize-not-working-with-translucent-action-navbar/22266717#22266717 可以看看这个
from statusbarutil.
@tanweijiu 这里面两个方法试过了,没起作用。还有我是配合https://blog.dreamtobe.cn/2015/09/01/keyboard-panel-switch/
这个使用StatusBarUtil的
from statusbarutil.
@wangshaolei 透明会影响?setColor 会出现问题不
from statusbarutil.
@laobie setColor不会出现问题。是FLAG_TRANSLUCENT_STATUS这个影响的,我也是昨天晚上发现的。
from statusbarutil.
@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.
@wangshaolei https://code.google.com/p/android/issues/detail?id=5497 然后你可以搜索一个工具类(AndroidBugSolutionAboutInputMethod.java)...
from statusbarutil.
@tanweijiu 没有搜到呢,有没有地址?thanks
from statusbarutil.
@tanweijiu 有没有很好解决方法呢,请教一下,你说的这个地址 貌似没有找到相关信息,谢谢~
from statusbarutil.
如果是透明状态栏,把布局改成relativeLayout,然后想要顶起的布局放到bottom,就能顶起来了,你们可以试下,我以前遇到过。
from statusbarutil.
同遇到 所以就没用透明了 好坑
from statusbarutil.
from statusbarutil.
Related Issues (20)
- 关于toolbar陷入到状态栏问题 HOT 5
- 请问是否支持androidx HOT 3
- 请问下如果想跟随滑动变化状态栏背景透明度且需要白色和黑色字体切换怎么实现啊 HOT 1
- 评论错项目了 HOT 1
- StatusBarUtil.setLightMode(this) => Toolbar goes behind statusBar HOT 1
- setDarkMode() 無效 HOT 1
- java.lang.ClassCastException(StatusBarUtil.clearPreviousSetting(StatusBarUtil.java:582))
- 软键盘导致ToolBar拉伸
- 使用之后,设置底部虚拟按键的背景颜色,设置不了
- calculateStatusColor() 算法问题
- setDarkMode 和 setLightMode 会使 布局向上偏移,设置fitsSystemWindows会使Edittextview长按上下文菜单边距失效 HOT 2
- 异形屏statusbar高度太低,导致内容被覆盖 HOT 1
- Status bar
- 有个StatusBarUtils的报错 能看下么 HOT 2
- 不维护了?什么时候适配水滴和挖孔屏
- 报错问题
- 1.5.1版本build失败
- 小米V130 com.jaeger.library.StatusBarUtil.setLightMode 报错org.json.JSONException: No value for cezanne
- 在清单文件里设置 android:windowSoftInputMode="adjustResize|stateHidden"软键盘不会顶起布局导致输入框被遮挡
- 兄弟们,这个库作者好久没更新了,有没有其他的同类型的优秀库推荐一下啊,快来交流一下 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statusbarutil.