一开始以为需要自己画
其实只需要隐藏掉他原生的东西就可以
隐藏下划线
android:background="@null"
光标颜色
android:textCursorDrawable="@drawable/cursor"
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <size android:width="2dp" /> <solid android:color="#27aee2" /> </shape>
默认edit text不获得焦点
根布局设置
android:focusable="true" android:focusableInTouchMode="true"
给背景图片加阴影
Drawable bg = getResources().getDrawable(R.drawable.login_nice_bg); bg.setColorFilter(Color.parseColor("#C7C7C7"),PorterDuff.Mode.MULTIPLY); ((View)findViewById(R.id.ll).getParent()).setBackground(bg);
隐藏状态栏、actionbar
style增加
<style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item