Android 常用API

来源:互联网 发布:淘宝店铺取名字 编辑:程序博客网 时间:2024/06/05 17:54

1、onItemClick

public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3)各项的意义:arg1是当前item的view,通过它可以获得该项中的各个组件。               例如arg1.textview.settext("asd");                      arg2是当前item的ID。这个id根据你在适配器中的写法可以自己定义。           arg3是当前的item在listView中的相对位置! 

2、shader

    /** Create a shader that draws a radial gradient given the center and radius.        @param centerX     The x-coordinate of the center of the radius        @param centerY     The y-coordinate of the center of the radius        @param radius      Must be positive. The radius of the circle for this gradient        @param centerColor The color at the center of the circle.        @param edgeColor   The color at the edge of the circle.        @param tileMode    The Shader tiling mode    */    public RadialGradient(float centerX, float centerY, float radius,            int centerColor, int edgeColor, @NonNull TileMode tileMode) {        if (radius <= 0) {            throw new IllegalArgumentException("radius must be > 0");        }        mType = TYPE_COLOR_CENTER_AND_COLOR_EDGE;        mX = centerX;        mY = centerY;        mRadius = radius;        mCenterColor = centerColor;        mEdgeColor = edgeColor;        mTileMode = tileMode;        init(nativeCreate2(centerX, centerY, radius, centerColor, edgeColor, tileMode.nativeInt));    }


0 0