1

Android native を使用して、下の画像のような EditText を作成したいと思いますandroid.support.design.widget.TextInputLayout

より明確に、ヒントは複数行で表示する必要があります。

画像

のようにエスケープ文字\nを追加しようとしましたstring.xml

<string name="mobile_comp">Mobile Number \n (For chat...)</string>

EditText内部に配置すると機能しないようTextInputLayoutです。だから、ここで何が間違っているのか知っている人はいますか? サーフィンしたけど理由が分からない?

コード

 <android.support.design.widget.TextInputLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginBottom="@dimen/text_input_margin"
                            android:layout_marginTop="@dimen/text_input_margin">

                            <com.ribbnapp.ribbn.views.EditText
                                android:id="@+id/mobile"
                                style="@style/EditText"
                                android:layout_width="match_parent"
                                android:layout_height="@dimen/edit_text_height"
                                android:layout_marginRight="80dp"
                                android:drawableLeft="@drawable/ic_mobile_number2"
                                android:drawablePadding="@dimen/drawable_padding"
                                android:hint="@string/mobile_comp"
                                android:imeOptions="actionDone"
                                android:inputType="phone"
                                android:maxLength="10"
                                android:singleLine="true"
                                android:textAppearance="?android:textAppearanceSmall" />
                        </android.support.design.widget.TextInputLayout>

Gradle の依存関係

 // App common
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.android.support:support-v4:23.1.0'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile "com.daimajia.swipelayout:library:1.2.0@aar"
    // Facebook SDK
    compile 'com.facebook.android:facebook-android-sdk:4.+'
4

0 に答える 0