@BlackWolf : yes i do this way. But actually it's still a bit inconvenient, since it's not visual at all. I can just change the identity to my custom class, but the custom view still appears as a white rectangle, and i have to manually change the size. Let's say later i change the size of my custom view, then i also need to change everywhere i use it.
But i think it's the only way.
Anw, thanks all for your replies.