EditText Android



  • I've been dealing with the problem ofization of the lower lane EditText. We need a separate strip for each symbol introduced. Пример EditText

    Implemented by EditText and ImageView in RelativeLayout, and removed the gaps by subleting the symbols.

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
    
            &lt;RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="40dp"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="20dp"
                android:gravity="center"&gt;
    
                &lt;LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_centerHorizontal="true"
                    android:layout_centerVertical="true"
                    android:gravity="center"
                    android:orientation="horizontal"&gt;
    
    
                    &lt;EditText
                        android:id="@+id/et_code"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:background="@null"                                   
                        android:singleLine="true"
                        android:textColor="@color/black"
                        android:textSize="16dp" /&gt;
    
                &lt;/LinearLayout&gt;
    
                &lt;LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:orientation="horizontal"&gt;
    
                    &lt;ImageView
                        android:layout_weight="1"
                        android:layout_width="wrap_content"
                        android:layout_height="1px"
    
                        android:alpha="0.3"
                        android:background="@color/black" /&gt;
    
                    &lt;ImageView
                        android:layout_marginLeft="10dp"
                        android:layout_marginRight="10dp"
                        android:layout_weight="1"
                        android:layout_width="wrap_content"
                        android:layout_height="1px"
                        android:alpha="0.3"
                        android:background="@color/black" /&gt;
    
                    &lt;ImageView
                        android:layout_marginLeft="10dp"
                        android:layout_marginRight="10dp"
                        android:layout_weight="1"
                        android:layout_width="wrap_content"
                        android:layout_height="1px"
                        android:alpha="0.3"
                        android:background="@color/black" /&gt;
    
                    &lt;ImageView
                        android:layout_weight="1"
                        android:layout_width="wrap_content"
                        android:layout_height="1px"
                        android:alpha="0.3"
                        android:background="@color/black" /&gt;
    
                &lt;/LinearLayout&gt;
    
            &lt;/RelativeLayout&gt;
        &lt;/RelativeLayout&gt;
    

    The solution is more than bad, perhaps, who has encountered such evil?



  • How about the use of the solutions that have been prepared?

    I think so. https://github.com/glomadrian/material-code-input That's what you need, Material Design style.

    One more option, https://github.com/Philio/PinEntryView ♪ There's a little bit of default on the squeaks you want, but according to the description on the guitar, there's a lot of possibilities for castomization.

    There's no problem in both options with shifting tricks into entry.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2