<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:shadowColor="#40000000" android:shadowDx="0" android:shadowDy="8" android:shadowRadius="1" android:layout_margin="20dip" android:text="底部阴影效果" android:textSize="20sp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:shadowColor="#40000000" android:shadowDx="0" android:shadowDy="-5" android:shadowRadius="1" android:layout_margin="20dip" android:text="顶部阴影" android:textSize="20sp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:shadowColor="#40000000" android:shadowDx="-5" android:shadowDy="0" android:shadowRadius="1" android:layout_margin="20dip" android:text="左侧阴影" android:textSize="20sp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:shadowColor="#40000000" android:shadowDx="5" android:shadowDy="0" android:shadowRadius="1" android:layout_margin="20dip" android:text="右侧阴影" android:textSize="20sp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:shadowColor="#40000000" android:shadowDx="5" android:shadowDy="5" android:shadowRadius="1" android:layout_margin="20dip" android:text="右下侧阴影" android:textSize="20sp"/> </LinearLayout>
相关推荐
Android 点击TextView 改变背景色
设置view的圆角和背景一般都是在xml里面通过selector的配置文件来...在项目中有个需求,背景颜色是从网络获取的,而且要设置为圆角,想了一下,通过xml的形式貌似实现不了,只能通过代码分别设置,就只能重写Textview。
动态设置textview指定颜色圆角背景
可以在代码中控制textView的边框颜色以及背景颜色,避免过多的绘制不同颜色的xml文件,使用时必须为textView设置一个默认的背景样式,但是有个弱点,在xml中设置默认背景时,修改后默认背景会一同被改变,所以尽量...
Android 设置textview某段字体颜色或者背景
GridView中的TextView选中背景变色
Android中带圆角以及不同背景颜色的TextView,如果使用xml实现的话针对不同的颜色需要写一个xml文件,这样太繁琐了,所以就自己写了一个控件,只要设置一下属性就可以达到想要的目的
android TextView android TextView
自定义圆形Textview,背景可以是方形,圆形或者圆角,字体可以设置大小和颜色,可以用作自定义文字头像
Android textview 文字中间加上图片
Android 为textView增加边框效果,这又是一个初级的Android文字布局示例,今天是为TextView文字框增加一个外边框,可实现在画布上画边框的功能,在填充方面,你还可使用不透明的9.png和透明的9.png,带边框的...
这个代码主要以Android中的TextView发生变化,而凡是订阅了此类消息的实体类对象均能够打印出日志。例子很简单,起抛砖引玉,希望大家能够理解观察者模式在Android中的应用
Android 根据搜索内容实现TextView中的文字部分加粗
用paint画笔给TextView设置背景颜色和宽高
TextView 高级应用技巧,
通过textview设置状态选择
android之为TextView打上多标签
Android TextView 控件例子
有时候看到原型图上要求图片和文字对齐,但是直接使用TextView的话总是有一段空白,这里直接继承TextView重写onDraw方法去掉上下边距,但是简单粗暴,导致只能显示文字,没有TextView其他的功能了。