2017-03-21 12 views
1

私は仕事のために、このカスタムレイアウトにする必要があります:私は内部のEditTextとカスタムフレームを使用しましたが、今、私は大きなものを必要とするので、私は描画可能なを作成する必要が前に enter image description hereこのカスタムイメージビュー/テキストビューの作成方法は?

を。

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="rectangle"> 
    <stroke android:width="1dp" 
     android:color="#EBEBE1" /> 

    <padding android:left="5dp" 
     android:top="5dp" 
     android:right="5dp" 
     android:bottom="5dp"/> 
</shape> 

誰もこれを完了するために私を助けることができる: 問題は、私はドローアブルとよくないんだと私はこのレイアウトを作っているということでしょうか?カスタムのTextViewのため

おかげ

+0

私はバックグラウンドで画像を使うのが最善の方法だと思います。もし私が間違っていれば私を訂正してください。 –

+0

@MayurRaval私もこれと思いますが、問題は私が良い結果がなければとても多くのメモリを使用していることです – ste9206

+0

私はmayurと同意します。背景に9パッチの画像を使用します –

答えて

0

私は、これらのは良い方法だと思います。

<RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:gravity="center" 
     android:layout_below="@id/layout1" 
     android:layout_marginTop="20dp" 
     > 
     <EditText 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:padding="15dp" 
      android:background="#ffffff" 
      android:hint="User Name/Email Address" 
      android:textSize="20dp" 
      android:layout_marginLeft="20dp" 
      android:layout_marginRight="20dp" 
      android:drawableLeft="@drawable/login_user_icon" 
      android:gravity="center_vertical" 
      android:drawablePadding="5dp" 
      android:id="@+id/etname" 
      /> 

     <EditText 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:padding="15dp" 
      android:background="#ffffff" 
      android:layout_below="@+id/etname" 
      android:hint="Password" 
      android:textSize="20dp" 
      android:layout_marginLeft="20dp" 
      android:layout_marginRight="20dp" 
      android:drawableLeft="@drawable/login_password_icon" 
      android:drawablePadding="5dp" 
      android:id="@+id/etpassword" 
      android:inputType="textWebPassword" 
      android:layout_marginTop="20dp" 
      /> 
    </RelativeLayout> 
関連する問題