Android Studio 中的 TextView 未显示

Step_Wisdom

使用线性布局时,只显示第一个 TextView 中的文本,即“嘿,我是新来的”。我怎么能也显示“领取你的奖品!” 和“Clicca qui”?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:padding="16dp">

<TextView
    android:id="@+id/titleTextView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="5dp"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp"
    android:lines="1"
    android:text="Hey I am new here"
    android:textSize="20sp"
    android:textStyle="bold" />
 <TextView
    android:id="@+id/prize_id"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    android:layout_marginLeft="16dp"
    android:layout_marginRight="16dp"
    android:lines="2"
    android:text="Claim your prize!"
    android:textSize="20sp" />
<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="16dp"
    android:id="@+id/buttonid"
    android:text="Clicca qui"
    android:onClick="prize claimed"  />

</LinearLayout>
阿西什·拉蒂

如果要在垂直堆栈中显示,请使用android:orientation="vertical"代替android:orientation="horizontal"for LinearLayout

如果你想在水平堆栈中显示给weight每个TextView.

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章