이 레이아웃을 구현하고 싶은데 방법을 모르겠습니다. 아이콘 없이는 너무 간단하지만 아이콘으로 무엇을 해야할지 모르겠습니다. 삼각형 아이콘이 표시되지 않습니다.
이것이 내가 한 일입니다.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:padding="60dp">
<TextView
android:id="@+id/lblmessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="برای ثبت نام شماره تلفن همراه خود را وارد کنید. همچینن کد تایید برای همین شماره پیامک می شود که در ادامه به آن نیاز دارید."
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/Alert"
android:src="@drawable/image9"
android:layout_centerHorizontal="false"
android:layout_alignTop="@+id/lblmessage"
android:layout_toRightOf="@+id/lblmessage" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:inputType="phone"
android:ems="10"
android:id="@+id/txtPhone"
android:layout_centerVertical="true" />
</RelativeLayout>
drawableLeft
및 drawableRight
속성을 사용 하여 에서 아이콘을 설정할 수 있습니다 EditText
.
그리고 경고 이미지 layout_toLeftOf
의 메시지 TextView
lef 를 설정합니다 .
예 :
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:padding="60dp">
<TextView
android:id="@+id/lblmessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="برای ثبت نام شماره تلفن همراه خود را وارد کنید. همچینن کد تایید برای همین شماره پیامک می شود که در ادامه به آن نیاز دارید."
android:layout_toLeftOf="@+id/Alert"
android:paddingTop="15dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/Alert"
android:src="@drawable/image9"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:inputType="phone"
android:ems="10"
android:id="@+id/txtPhone"
android:layout_centerVertical="true"
android:drawableLeft="@drawable/editTextLeftIcon"
android:drawableRight="@drawable/editTextRightIcon"/>
</RelativeLayout>
업데이트 :
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:padding="30dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="30dp">
<TextView
android:id="@+id/lblmessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="برای ثبت نام شماره تلفن همراه خود را وارد کنید. همچینن کد تایید برای همین شماره پیامک می شود که در ادامه به آن نیاز دارید." />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:inputType="phone"
android:ems="10"
android:id="@+id/txtPhone"
android:layout_centerVertical="true"
android:drawableLeft="@drawable/editTextLeftIcon"
android:drawableRight="@drawable/editTextRightIcon"/>
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/Alert"
android:src="@drawable/image9"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:paddingTop="20dp" />
</RelativeLayout>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다