Ⅰ android 上阴影效果怎么做
设置阴影需要按照以下步骤:
1、设置eleavation值;
2、添加一个背景或者outline。
可以在xml中通过定义一个背景来设置outline:
<TextView
android:id="@+id/myview"
...
android:elevation="2dp"
android:background="@drawable/myrect" />
<!-- res/drawable/myrect.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#42000000" />
<corners android:radius="5dp" />
</shape>
也可以通过代码来创建一个outline:
/* Get the size of the shape from resources. */
int shapeSize = getResources().getDimensionPixelSize(R.dimen.shape_size);
/* Create a circular outline. */
mOutlineCircle = new Outline();
mOutlineCircle.setRoundRect(0, 0, shapeSize, shapeSize, shapeSize / 2);
/* Create a rectangular outline. */
mOutlineRect = new Outline();
mOutlineRect.setRoundRect(0, 0, shapeSize, shapeSize, shapeSize / 10);
Ⅱ 请问安卓浏览器字体脚本执行需要费(单独调用字体阴影特效)流量吗
直接运行会费流量。
把字体的脚本下载下来运行,这样就不费流量了。
Ⅲ android中如何设置字体边缘渐变,求指点
你指的是阴影效果吧,代码如下:
android:shadowColor="#ff000000"
android:shadowDx="2.0"
android:shadowDy="2.0"
android:shadowRadius="2.0"
android:textStyle="bold"
如果太炫的效果,就得重写TextViewl了,一般阴影效果就够了
Ⅳ Android textview 怎么实现点击后中文字体变粗的效果和点击后出现阴影的效果
下面是自己做的一个效果,可以拷贝到自己的项目里面看看,因为网络原因就不上传结果图了
1.MainActivity.java
packagecom.example.a07;
importandroid.app.Activity;
importandroid.graphics.Color;
importandroid.graphics.Typeface;
importandroid.os.Bundle;
importandroid.view.View;
importandroid.view.View.OnClickListener;
importandroid.widget.TextView;
{
privateTextViewtv;
@Override
protectedvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv=(TextView)this.findViewById(R.id.tv);
tv.setOnClickListener(newOnClickListener(){
@Override
publicvoidonClick(Viewarg0){
//粗体
tv.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
//模糊度//阴影离开文字的x横向距离//y距离//阴影颜色
tv.setShadowLayer(1F,20F,-20F,Color.GRAY);
}
});
}
}
2.activity_main.xml
<LinearLayoutxmlns: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">
<TextView
android:id="@+id/tv"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="点击后中文字体变粗的效果和点击后出现阴影的效果"
android:textSize="25sp"/>
</LinearLayout>
满意请采纳
Ⅳ 华为手机桌面字体阴影怎么去掉
您好,方法
如果滑动屏幕文字出现拖影,快速滑动屏幕时有拖影是正常现象,采用液晶屏幕的手机都有此现象。
可以点击设置>显示>色温,进行以下调节:
1.色温选项由默认改为冷色,可改善拖影效果;
华为手机字体阴影怎么去掉
2.若上述操作后仍有拖影,就将色盘上的色坐标向右下斜向45°拖动到圆盘边缘,可改善拖影效果。
华为手机字体阴影怎么去掉
如果开启了护眼模式:点击设置>显示>护眼模式,将护眼模式菜单下的色温向冷色方向拖动,可改善拖影效果。
华为手机字体阴影怎么去掉
重启下手机或者一直按住图标,直到手机轻微震动一下,就可以拖动了,这时你会发现在屏幕上多出了一个垃圾桶的图标(一般不再手机屏幕底部就在顶部),然后把图标拖进去,整个过程都要摁住,不要放手。
华为手机字体阴影怎么去掉
华为于1987年在中国深圳正式注册成立。 华为技术有限公司是一家生产销售通信设备的民营通信科技公司,总部位于中国广东省深圳市龙岗区坂田华为基地。华为的产品主要涉及通信网络中的交换网络、传输网络、无线及有线固定接入网络和数据通信网络及无线终端产品,为世界各地通信运营商及专业网络拥有者提供硬件设备、软件、服务和解决方案。
Ⅵ android手机中的部分文字变成阴影,但并不是一般的乱码,请高手帮忙解决,见下图
你用的系统应该是安卓4.0吧,是安卓的原因。这是因为目前4.0的不太稳定,4.0.4以后就要好很多了。基本不会出问题了。 现在一些设备的官方已经出稳定版了。你可以升级一下你的机器的系统,也可以降级到2.3.5版。
Ⅶ Android如何纯java代码实现字体阴影效果
Android实现纯java代码字体阴影效果,主要是通过activity的draw方法,进行重新绘制,如下代码:
packagecanvas.test;
importandroid.app.Activity;
importandroid.os.Bundle;
importandroid.content.Context;
importandroid.graphics.Bitmap;
importandroid.graphics.BitmapFactory;
importandroid.graphics.Canvas;
importandroid.graphics.Color;
importandroid.graphics.Paint;
importandroid.graphics.PorterDuff;
importandroid.graphics.PorterDuff.Mode;
importandroid.graphics.PorterDuffXfermode;
importandroid.graphics.Rect;
importandroid.graphics.RectF;
importandroid.graphics.drawable.Drawable;
importandroid.view.View;
{
@Override
publicvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedInstanceState);
setContentView(newImageEffect(this));
}
classImageEffectextendsView{
Paintpaint;
publicImageEffect(Contextcontext){
super(context);
paint=newPaint();//初始化画笔,为后面阴影效果使用。
paint.setAntiAlias(true);//去除锯齿。
paint.setShadowLayer(5f,5.0f,5.0f,Color.BLACK);//设置阴影层,这是关键。
paint.setXfermode(newPorterDuffXfermode(Mode.SRC_IN));
}
@Override
publicvoidonDraw(Canvascanvas){
super.onDraw(canvas);
intposX=20;
intposY=50;
intPicWidth,PicHegiht;
Drawabledrawable=getResources().getDrawable(R.drawable.button);
Drawabledbe=getResources().getDrawable(R.drawable.button).mutate();//如果不调用mutate方法,则原图也会被改变,因为调用的资源是同一个,所有对象是共享状态的。
DrawabledrawTest=getResources().getDrawable(R.drawable.button);
Bitmapbmp=BitmapFactory.decodeResource(getResources(),R.drawable.button);
PicWidth=drawable.getIntrinsicWidth();
PicHegiht=drawable.getIntrinsicHeight();
drawTest.setBounds(posX,(2*posY)+PicHegiht,posX+PicWidth,(2*posY)+2*PicHegiht);
drawable.setBounds(posX,posY,posX+PicWidth,posY+PicHegiht);
dbe.setBounds(0,0,PicWidth,PicHegiht);
canvas.drawColor(Color.WHITE);//设置画布颜色
canvas.save(Canvas.MATRIX_SAVE_FLAG);
dbe.setColorFilter(0x7f000000,PorterDuff.Mode.SRC_IN);
canvas.translate(posX+(int)(0.9*PicWidth/2),posY+PicHegiht/2);//图像平移为了刚好在原图后形成影子效果。
canvas.skew(-0.9F,0.0F);//图像倾斜效果。
canvas.scale(1.0f,0.5f);//图像(其实是画布)缩放,Y方向缩小为1/2。
dbe.draw(canvas);//此处为画原图像影子效果图,比原图先画,则会在下层。
drawable.clearColorFilter();
canvas.restore();
canvas.save(Canvas.MATRIX_SAVE_FLAG);
drawable.draw(canvas);//此处为画原图像,由于canvas有层次效果,因此会盖在影子之上。
canvas.restore();
//默认无效果原图
canvas.save(Canvas.MATRIX_SAVE_FLAG);
drawTest.draw(canvas);
canvas.restore();
//图片阴影效果
canvas.save(Canvas.MATRIX_SAVE_FLAG);
//Rectrect=newRect(2*posX+PicWidth,2*posY+PicHegiht,2*posX+2*PicWidth,2*posY+2*PicHegiht);//此为理论上的阴影图坐标
Rectrect=newRect(2*posX+PicWidth+3,2*posY+PicHegiht+3,2*posX+2*PicWidth-2,2*posY+2*PicHegiht-2);
//由于图片的实际尺寸比显示出来的图像要大一些,因此需要适当更改下大小,以达到较好的效果
RectFrectF=newRectF(rect);
canvas.drawRoundRect(rectF,10f,10f,paint);//在原有矩形基础上,画成圆角矩形,同时带有阴影层。
canvas.drawBitmap(bmp,2*posX+PicWidth,2*posY+PicHegiht,null);//画上原图。
canvas.restore();
}
}
}
Ⅷ 字体的阴影效果怎么设置
1、使用WPS Office软件打开Word文档,选中要设置阴影的字体,击右键,选择“字体”菜单;
2、在页面弹出的菜单中,选择“文本效果”按钮;
3、在打开的文本效果页面中,点击顶部“效果”按钮;
4、在打开的文本效果页面中,点击“阴影”设置项;
5、选择文字的阴影效果之后,点击“确定”按钮,即可完成文字的阴影设置。
Ⅸ android 文字怎么加阴影效果 怎么无效
Android:shadowColor 阴影颜色
android:shadowDx 阴影的水平偏移量
android:shadowDy 阴影的垂直偏移量
android:shadowRadius 阴影的范围
为了统一风格和代码的复用,通常可以把这个样式抽取放入到style.xml文件中
<TextView
style="@style/textstyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="字体样式"
android:textSize="30sp"
android:textStyle="bold" />
样式实现:
<?xmlversion="1.0"encoding="utf-8"?>
<resources>
<stylename="textstyle">
<itemname="android:shadowColor">#ff0000ff</item>
<itemname="android:shadowRadius">10</item>
<itemname="android:shadowDx">5</item>
<itemname="android:shadowDy">5</item>
</style>
</resources>
关于android文字阴影,共有四个属性可以设置:
android:shadowColor :阴影颜色
android:shadowDx :阴影x方向位移
android:shadowDy :阴影y方向位移
android:shadowRadius :阴影的半径
注意:阴影的半径必须设,为0时没有效果。
下面为改变x位移:
android:shadowColor="#ff000000" (前两位为透明度)
android:shadowDx="2"
android:shadowDy="0"
android:shadowRadius="1"
效果(向右为正):
下面为改变y位移:
android:textColor="#979790"
android:shadowColor="#ff000000"
android:shadowDx="0"
android:shadowDy="2"
android:shadowRadius="1"
效果(向下为正):
下面改变半径:
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"
Ⅹ 安卓4.0怎么加上桌面文字阴影
用个holo
launcher或者apex桌面,和4.0原生桌面界面完全一样,尤其是apex桌面
什么都可以自定义的,呵呵