using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Drawing.Drawing2D; namespa
实现 图片的放大,缩小,左右屏幕滑动 。 直接贴代码吧。。 public class ViewPager extends ViewGroup { private static final String TAG = "ViewPager"; private static final boolean DEBUG = false; private static final boolean USE_CACHE = false; private static final int DEFAULT_OFFS
package com.example.game2048; import java.util.ArrayList; public class GameView extends GridLayout { private List emptyPoints=new ArrayList(); public GameView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); // T
/* * Copyright 2011 woozzu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.
一、首先看下支付宝上芝麻信用分的效果图:
二、思路
1、确定雷达图中心点坐标
2、绘制多边形及连接线
3、根据维度值绘制覆盖区域
4、绘制分数
5、绘制每个维度的标题文字和图标
三、实现
获取布局的中心坐标
在onSizeChanged(int w, int h, int oldw, int oldh)方法里面,根据View的长宽,计算出雷达图的半径(这里取布局宽高最小值的四分之一,可以自定义),获取整个布局的中心坐标。
public
不知上一节高仿QQ未读消息气泡大家还喜欢么,今天继续练习贝赛尔曲线,这一节我们通过贝赛尔曲线和属性动画估值器实现添加至购物车的运动轨迹,效果如下:
1、新建自定义View,重写构造方法,初始化Paint、Path;
2、确定起始点、终止点、控制点坐标,这里我们直接固定:
Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, ol