Hi, I am new to Android. Now I am trying to create a rectangle with four edges of different color as my GriewView's selector. Here is my codes. But I what I get is a rectangle with four edges in same color. Anyone can help?
-------------------------------------------------------------------------------------------------------------------------------------------- Path mPath = new Path(); ShapeDrawable mSelector = new ShapeDrawable(new PathShape(mPath, 100,100)); Paint mPaint = mSelector.getPaint(); mPaint.setColor(0xFFFF0000); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth(1); mPath.moveTo(0, 0); mPath.lineTo(100, 0); mPaint.setColor(0xFFFFFFFF); mPath.lineTo(100, 100); mPaint.setColor(0xFF3079C4); mPath.lineTo(0,100); mPaint.setColor(0xFFFFF000); mPath.lineTo(0, 0); mGridview.setSelector(mSelector); ------------------------------------------------------------------------------------------------------------------------------------------------ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---