小编Ale*_* Sh的帖子

在 Android 上的 Paint 和 Canvas 中更改颜色

对不起,如果这个问题很愚蠢,但我是 Android 新手。我在 developer.android.?om 上阅读了很多,但不幸的是没有找到我的问题的解决方案。我在 sta?koverflow 上找到的大部分代码都完成了部分本身。这个 View 插入到 Activity 的 FrameLayout 中,覆盖文本,并允许您在电子书中留下笔记。

import java.util.ArrayList;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;

public class PaintSurface extends View implements OnTouchListener {

    private Canvas canvas;
    private Path path;
    private Paint paint;
    private ArrayList<Path> paths = new ArrayList<Path>();

    public PaintSurface(Context context) {
        super(context);
        setFocusable(true);
        setFocusableInTouchMode(true);

        this.setOnTouchListener(this);

        paint = new Paint();
        paint.setAntiAlias(true);
        paint.setDither(true);
        paint.setStyle(Paint.Style.STROKE);
        paint.setStrokeJoin(Paint.Join.MITER);
        paint.setStrokeCap(Paint.Cap.SQUARE);
        paint.setColor(Color.RED);
        paint.setStrokeWidth(16);
        paint.setAlpha(100);
        canvas = new Canvas();
        path = …
Run Code Online (Sandbox Code Playgroud)

android paint android-canvas

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

用户信息来自Android中的VKontakte

我正在编写一个需要使用从客户端社交网络VKontakte获取的用户数据的应用程序.我确实授权VKontakte.

VKSdk.initialize(sdkListener, String.valueOf(idVK), VKAccessToken.tokenFromSharedPreferences(this, sTokenKey));
Run Code Online (Sandbox Code Playgroud)

并获得了AccessToken.现在我得到名字和电子邮件用户?

android vk

4
推荐指数
1
解决办法
5540
查看次数

WebView中页面可见部分的屏幕截图

在我的应用程序中是一个WebView小部件,它打开一个大页面.如何在WebView中捕获页面的可见部分?capturePicture()不适合它......

android android-webview android-screen

2
推荐指数
1
解决办法
1575
查看次数