Tag: android style

EditText和TextInputLayout以编程方式添加不采摘风格,不显示软键盘

我正在开发一个库模块,我希望允许客户端为EditText和TextInputLayout UI组件传递样式资源。 为了使用传递的布局,我需要在运行时对这两个组件进行充气,并将它们添加到父布局中。 当我这样做,一个奇怪的行为发生: InputTextLayout不会选择传递的样式; 点击EditText时,软键盘不会被触发。 父级布局 <android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar_wrapper" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.Toolbar android:id="@+id/search_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorPrimary" android:minHeight="?attr/actionBarSize" app:layout_scrollFlags="scroll|enterAlways"> <LinearLayout android:id="@+id/toolbar_inner_container" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:gravity="center_vertical" android:orientation="horizontal" android:padding="3dip" android:weightSum="7"> <ImageView android:id="@+id/back" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:src="@drawable/ic_arrow_left_white_24dp" /> </LinearLayout> </android.support.v7.widget.Toolbar> <br.com.edsilfer.kotlin_support.presenter.layout.LineProgressBar android:layout_width="match_parent" android:layout_height="wrap_content" app:colorLine="@color/clr_theme_light_text" /> 样本预设样式: <!– THEME LIGHT –> <!– search bar input text –> <style name="TextInputThemeDark"> […]