私はshow password imageViewでパスワードにEditText
を設計しようとしています。しかし私は以来、私はImageView
を見ることができません正しくbeacuseを設計することはできません。 wrap_content
に変更すると、ImageView
が表示されますが、UIでは非常に悪いです。固定サイズを与えずにデザインすることは可能ですか?show passwordボタンでパスワードテキストを設計する
ここは私のコードです。
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:layout_marginBottom="8dp">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<EditText
android:id="@+id/registerPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/register_password"
android:inputType="textPassword" />
<ImageView
android:id="@+id/fragment_login_password_visibility"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@android:drawable/ic_partial_secure"
android:layout_gravity="center"
android:clickable="true"/>
</LinearLayout>
</android.support.design.widget.TextInputLayout>
EDIT:
アンドロイド:layout_weight = 1つの解決される問題。これで、ImageTextがEditTextのままになっています。しかし、今、私はTextInputLayoutヒントが動作していません。
最新のサポートライブラリが組み込まれていたパスワードトグルのサポート割り当てます。 https://developer.android.com/topic/libraries/support-library/revisions.html#rev24-2-0 – Budius