Introduction to Android Views and Custom Views

Introduction to Android Views and Custom Views

Introduction to Android Views and Custom Views

Android offers various UI components like Buttons, TextViews, and ImageViews. But sometimes, you might need a custom view.

Creating a Custom View

    public class CustomView extends View {
        public CustomView(Context context) {
            super(context);
        }

        @Override
        protected void onDraw(Canvas canvas) {
            super.onDraw(canvas);
            Paint paint = new Paint();
            paint.setColor(Color.BLUE);
            canvas.drawRect(0, 0, getWidth(), getHeight(), paint);
        }
    }
  

Comments

Popular posts from this blog

Wi-Fi Knowledge Sharing

ဘာလို့ Android Developer လမ်းကြောင်းကိုရွေးချယ်သင့်လဲ

Implementing Push Notifications in Android