相关疑难解决方法(0)

Android - 文字阴影?

我想知道如何在android中的文本上添加阴影?

我有以下代码应用于位图,我想被阴影...

paint.setColor(Color.BLACK);
paint.setTextSize(55);
paint.setFakeBoldText(false);
paint.setShadowLayer(1, 0, 0, Color.BLACK); //This only shadows my whole view...
Run Code Online (Sandbox Code Playgroud)

android

177
推荐指数
3
解决办法
13万
查看次数

如何在Android中的MapView上绘制带边框的文本?

我正在尝试在Android上的MapView上绘制一些文本.文本的绘制很顺利,但是阅读文本非常困难,因为它是白色的,没有黑色边框(就像MapViews上自然出现的其他文字一样,表示城市,州和国家).我似乎无法想象如何用黑色边框绘制文本.有人知道怎么做吗?

这是我现在正在使用的那种代码(这只是我在其中一个叠加层中找到的示例代码):

@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
    Paint textPaint = new Paint();
    textPaint.setARGB(255, 255, 255, 255);
    textPaint.setTextAlign(Paint.Align.CENTER);
    textPaint.setTextSize(16);
    textPaint.setTypeface(Typeface.DEFAULT_BOLD);

    canvas.drawText("Some Text", 100, 100, textPaint);

    super.draw(canvas, mapView, shadow);
}
Run Code Online (Sandbox Code Playgroud)

android google-maps android-mapview

33
推荐指数
3
解决办法
5万
查看次数

标签 统计

android ×2

android-mapview ×1

google-maps ×1