我的布局文件如下:
<?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>
活动看起来像这样
但是,我希望文本Use comma....
显示在编辑文本的顶部而不是中心。我尝试设置gravity:top
,但没有帮助。此外,如您所见,整个提示没有显示,其中一些被隐藏(我希望其余的出现在下一行)。我该如何纠正这两个问题?
我的emailText
风格是:
<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>