android - xml appears white when textview centred -


for strange reason, when centre hint of edittext using gravity centre, view of xml turns white shown:

enter image description here

but when unclick centre, colour goes normal, if can point me in right direction on how fix this, appreciate it. when run app, colour appears normal (if use gravity centre).

enter image description here

xml follows:

<?xml version="1.0" encoding="utf-8"?> <relativelayout 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:background="@color/facebookblue" tools:context="com.test.practise.teamactivity">   <textview     android:id="@+id/textview"     android:layout_width="290dp"     android:layout_height="41dp"     android:layout_above="@+id/textview2"     android:layout_centerhorizontal="true"     android:layout_marginbottom="30dp"     android:gravity="center"     android:text="bournemouth university"     android:textcolor="@android:color/background_light"     android:textsize="24sp"     tools:layout_editor_absolutex="65dp"     tools:layout_editor_absolutey="105dp" />  <textview     android:id="@+id/textview2"     android:layout_width="129dp"     android:layout_height="34dp"     android:layout_marginbottom="70dp"     android:gravity="center"     android:text="team mode"     android:textcolor="@android:color/background_light"     android:textsize="24sp"     tools:layout_editor_absolutex="128dp"     tools:layout_editor_absolutey="169dp"     android:layout_above="@+id/et_team"     android:layout_centerhorizontal="true" />   <edittext     android:id="@+id/et_team"     android:layout_width="232dp"     android:layout_height="37dp"     android:layout_centerhorizontal="true"     android:layout_centervertical="true"     android:background="@android:color/background_light"     android:ems="10"     android:hint="team name"     android:imeoptions="actiondone"     android:inputtype="text"     android:singleline="true"     tools:layout_editor_absolutex="78dp"     tools:layout_editor_absolutey="258dp" />  <android.support.v7.widget.appcompatbutton     android:id="@+id/btn_submit_team"     android:layout_width="239dp"     android:layout_height="43dp"     android:layout_alignend="@+id/et_team"     android:layout_alignleft="@+id/et_team"     android:layout_alignright="@+id/et_team"     android:layout_alignstart="@+id/et_team"     android:layout_below="@+id/et_team"     android:layout_margintop="38dp"     android:background="@color/colorprimarydark"     android:elevation="23dp"     android:text="ok, go!"     android:textcolor="@android:color/background_light"     tools:layout_editor_absolutex="75dp"     tools:layout_editor_absolutey="325dp" />  <textview     android:id="@+id/tv_login"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_alignparentleft="true"     android:layout_alignparentstart="true"     android:layout_marginbottom="23dp"     android:layout_marginleft="27dp"     android:layout_marginstart="27dp"     android:text="admin? click here"     android:textcolor="@android:color/background_light"     tools:layout_editor_absolutex="39dp"     tools:layout_editor_absolutey="475dp" />  <progressbar     android:id="@+id/progress"     style="@style/base.widget.appcompat.progressbar"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_alignparentleft="true"     android:layout_alignparentstart="true"     android:layout_below="@+id/btn_submit_team"     android:layout_margintop="26dp"     android:indeterminate="true"     android:visibility="invisible" /> 

in java file try this;

 et_team.setgravity(gravity.center_horizontal); 

also android:singleline="true" deprectaed use maxlines instead


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -