私は絵にこのようなレイアウトを行う必要があります。AndroidでLinearLayoutデザインを作成するには?
ここSpinner
値、そして我々は携帯電話番号を入れて持っている1 EditText
に応じて変化する国があります。 EditText
は、 - の形式を持つ必要があります。国コードはAPIから取得され、その番号はユーザーによって供給されます。しかし、これはEditText
としてのみ表示され、TextView
と表示されず、LinearLayout
にはEditText
と表示されます。
どうすればこの問題を解決できますか?
あなたがこれを達成することができますいくつかの方法があります<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"
xmlns:fb="http://schemas.android.com/apk/res-auto"
android:background="@drawable/common_bg"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:context="com.pigeonmarket.PMRegisterActivity">
<!-- Login progress -->
<ProgressBar
android:id="@+id/login_progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:visibility="gone" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/registerform"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp">
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/toolbar_new"
android:layout_centerHorizontal="true"
android:text="REGISTER"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#fff"
android:textSize="18dp" />
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:background="@drawable/signup_icon" />
<EditText
android:id="@+id/sname"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="14dp"
android:hint="Name"
android:paddingLeft="15dp"
android:textSize="14dp"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true" />
<Spinner
android:layout_width="match_parent"
android:layout_height="60dp"
style="?android:attr/spinnerItemStyle"
android:id="@+id/fbcountry"
android:paddingLeft="15dp"
android:layout_marginTop="12dp"
android:drawableRight="@drawable/down_arrow"
android:drawablePadding="15dp"
android:paddingRight="15dp"
android:spinnerMode="dialog"
android:layout_below="@+id/sname"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="60dp"
android:paddingLeft="35dp"
android:layout_below="@+id/fbcountry"
android:layout_alignR="@+id/fbcountry"
android:hint="+"
android:layout_marginTop="30dp"
android:textSize="14dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="60dp"
android:paddingLeft="50dp"
android:layout_below="@+id/fbcountry"
android:layout_alignR="@+id/fbcountry"
android:hint="code"
android:layout_marginTop="30dp"
android:textSize="14dp"
android:id="@+id/calling_code" />
<EditText
android:layout_width="wrap_content"
android:layout_height="60dp"
android:paddingLeft="90dp"
android:layout_below="@+id/fbcountry"
android:layout_alignR="@+id/fbcountry"
android:hint="Mobile Number"
android:layout_marginTop="10dp"
android:textSize="14dp"
android:id="@+id/mob" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
絵がある後、彼の携帯電話番号を入力し続けることができれば、その後最初のテキストを編集するためのAPI値を設定すると思いますか? – user3040153
OKアップロードをもう一度待ちます – user7316606
plzもう一度私はアップロードしました – user7316606