android - TextInputEditText view not rendering as expected -
my problem textinputedittext
view not expand take entire width of parent expect using android:layout_width="match_parent"
. code below snippet application:
<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.constraintlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/constraintlayout"> <android.support.design.widget.textinputlayout android:layout_width="0dp" android:layout_height="wrap_content" android:id="@+id/textinputlayout1" android:layout_margintop="16dp" app:layout_constrainttop_totopof="@+id/constraintlayout" android:layout_marginstart="16dp" app:layout_constraintleft_toleftof="@+id/constraintlayout" android:layout_marginleft="16dp" app:layout_constraintright_toleftof="@+id/guideline3" android:layout_marginend="8dp" android:layout_marginright="8dp"> <android.support.design.widget.textinputedittext android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/textinputedittext1"/> </android.support.design.widget.textinputlayout> <android.support.design.widget.textinputlayout android:layout_width="0dp" android:layout_height="wrap_content" android:id="@+id/textinputlayout2" android:layout_marginstart="16dp" app:layout_constraintleft_torightof="@+id/textinputlayout1" android:layout_marginleft="16dp" android:layout_marginend="16dp" app:layout_constraintright_torightof="@+id/constraintlayout" android:layout_marginright="16dp" app:layout_constrainttop_totopof="@+id/textinputlayout1" app:layout_constraintbottom_tobottomof="@+id/textinputlayout1"> <android.support.design.widget.textinputedittext android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/textinputedittext2" android:layout_weight="1" tools:layout_editor_absolutey="0dp" tools:layout_editor_absolutex="0dp"/> </android.support.design.widget.textinputlayout> <android.support.constraint.guideline android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/guideline3" app:layout_constraintguide_percent="51" android:orientation="vertical" tools:layout_editor_absolutey="0dp" tools:layout_editor_absolutex="216dp"/> </android.support.constraint.constraintlayout>
your code fine, using older version of constraintlayout
(e.g. alpha 4). try updating latest alpha 6, fix issue (you need replace app:layout_constraintguide_percent="51"
app:layout_constraintguide_percent="0.5"
there api change)
Comments
Post a Comment