gpt4 book ai didi

android - 更改单选按钮的文本格式并获取所有国家/地区的列表并将其放入微调器 Android

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:09:06 26 4
gpt4 key购买 nike

您好,下面是一个 Activity 的屏幕截图,其中包含供用户填写的详细信息列表。如您所见,选择性别单选按钮与 Activity 中的其余文本不匹配。它们是一种粗体文本。我想让它类似于 Activity 中的剩余文本,我该怎么做?

此外,我不想让用户键入州和国家名称,而是想在微调器中提供所有国家/地区的列表,并且根据所选国家/地区,州微调器应填充所选国家/地区的城市。我该怎么做?

enter image description here

下面是上述 Activity 的 xml 代码

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".RegisterActivity" >

<TextView
android:id="@+id/textView6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/topic"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@string/full_name" />

<EditText
android:id="@+id/fname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName" >

<requestFocus />
</EditText>

<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/email" />

<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textEmailAddress" />

<TextView
android:id="@+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/age" />

<EditText
android:id="@+id/age"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number" />

<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<RadioButton
android:id="@+id/radioMale"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/radio_male" />
<RadioButton
android:id="@+id/radioFemale"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/radio_female" />
</LinearLayout>

<TextView
android:id="@+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/postal_address" />

<EditText
android:id="@+id/address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPostalAddress" />

<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/state" />

<EditText
android:id="@+id/state"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textCapWords" />

<TextView
android:id="@+id/textView7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/country" />

<EditText
android:id="@+id/country"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textCapWords" />

<Button
android:id="@+id/done"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/done" />

最佳答案

为每个或您的单选按钮尝试 android:textAppearance="?android:attr/textAppearanceSmall"

关于android - 更改单选按钮的文本格式并获取所有国家/地区的列表并将其放入微调器 Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22525873/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com