1.TextView:
<TextView
android:id="@+id/tv_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center"
android:textColor="@color/light_blue"
android:textSize="14sp"
android:textStyle="bold" //字体样式
//=================设置图标=======================
android:drawableLeft="@drawable/alertwindows"
android:drawablePadding="10dp"
//====================取消默认的系统空白填充==============
android:includeFontPadding="false"
//=============文件添加阴影效果================
android:shadowColor="#0f0" //阴影颜色
android:shadowDx="0" //阴影水平偏移
android:shadowDy="1" //阴影垂直偏移
android:shadowRadius="1" //阴影的模糊半径
//=============走马灯效果===============
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
/>
更换TextView的字体:
1.将字体文件放到res/assets/font/ DS-DIGI.TTF
2.在onCreate()方法中给控件设置setTypeface()字体。
private void initFont()
{
Typeface localTypeface = Typeface.createFromAsset(getAssets(), "font/DS-DIGI.TTF");
this.timingTime1_TextView.setTypeface(localTypeface);
this.timingTime2_TextView.setTypeface(localTypeface);
this.timingTime3_TextView.setTypeface(localTypeface);
}
2.EditText:
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:hint="@string/wifi_password"
android:textColor="@color/brown"
android:textColorHint="@color/brown"
android:background="@drawable/bg_add_wifi_item"
android:textSize="24.0sp"
android:paddingLeft="20dp"
//=====================点击收起虚拟键盘=========================
android:imeOptions="actionDone"
android:singleLine="true"
//=====================输入方式============================
android:inputType="textNoSuggestions"
/>