Mój plik układ jest następujący:android EditText podpowiedź problem
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/page_background"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/label_background" >
<com.olacabs.customer.model.TextViewPlus
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="54dp"
android:background="@color/label_background"
android:gravity="center"
android:text="@string/invite_email"
android:textColor="@color/white"
android:textSize="22dp"
android:textStyle="bold"
custom:customFont="Roboto-Regular.ttf" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:gravity="top"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<com.olacabs.customer.model.TextViewPlus
android:id="@+id/emailHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:text="@string/enter_your_friend_s_email_address"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/heading_text_color"
custom:customFont="Roboto-Regular.ttf" />
<TextView
android:id="@+id/errorText"
style="@style/errorText"
android:layout_marginBottom="10dp"
android:visibility="gone" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="100dp"
android:background="@drawable/round_corners"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:padding="10dp" >
<EditText
android:id="@+id/emailText"
style="@style/emailText"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:hint="@string/email_ids_separated_by_commas"
android:imeOptions="actionGo" />
</LinearLayout>
<com.olacabs.customer.model.ButtonPlus
android:id="@+id/inviteButton"
style="@style/button_1"
android:layout_width="fill_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:text="@string/invite"
android:textStyle="normal"
custom:customFontButtonText="Roboto-Regular.ttf" />
</LinearLayout>
</LinearLayout>
Aktywność wygląda to
Jednakże chcę tekst Use comma....
do być wyświetlane u góry edytowanego tekstu, a nie w środku. Próbowałem ustawić gravity:top
, ale to nie pomogło. Ponadto, jak widać, cała wskazówka nie jest wyświetlana, a część z niej zostaje ukryta (chcę, aby reszta pojawiła się w następnej linii). Jak mogę poprawić te dwa problemy?
Moja emailText
styl:
<style name="emailText" parent="android:Widget.EditText">
<item name="android:ems">10</item>
<item name="android:inputType">textEmailAddress</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:hint">Email</item>
<item name="android:textColorHint">#B8B8B8</item>
<item name="android:textSize">15dp</item>
<item name="android:layout_height">45dp</item>
<item name="android:shadowColor">@color/white</item>
</style>
'Próbowałem ustawienie grawitacji: do góry, ale to nie pomogło - nadal był wyśrodkowany? – iTurki
tak. Nadal wyglądał dokładnie tak samo jak obraz – Ankush
Czy następny zaczyna się od góry, gdy coś wpiszesz? – PearsonArtPhoto