android - Toolbar TextInputLayout EditText - lost HINT -
please have problem second toolbar.
i want have textinputlayout in toolbar, not want focusable. used filters. user can not type edittext.
my code:
<android.support.v7.widget.toolbar android:id="@+id/toolbar_2" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorprimary" android:theme="@style/themeoverlay.appcompat.dark.actionbar" app:layout_collapsemode="none" app:elevation="0dp" app:layout_scrollflags="scroll" app:popuptheme="@style/themeoverlay.appcompat.light"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="?attr/selectableitembackground" android:gravity="center_vertical" android:minheight="@dimen/spacing_xxlarge"> <android.support.design.widget.textinputlayout android:id="@+id/lnamelayout2" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingleft="30dp" android:paddingstart="30dp" android:paddingend="30dp" android:paddingright="30dp"> <edittext android:id="@+id/ldesc" android:fontfamily="sans-serif-thin" android:clickable="false" android:cursorvisible="false" android:focusable="false" android:focusableintouchmode="false" android:layout_width="match_parent" android:layout_height="wrap_content" android:textsize="16sp" android:text="another toolbar text" android:textcolor="@color/colorprimaryblack" android:hint="@string/pref_title_filters"/> </android.support.design.widget.textinputlayout> </linearlayout> </android.support.v7.widget.toolbar>
when use: android:focusable="false" android:focusableintouchmode="false", hint disappear.
what should do? !! :)
programmatically, can following:
youredittext.setkeylistener(null); youredittext.settext("whatever want");
Comments
Post a Comment