Endre
Endre

Reputation: 414

Android: Is it possible to set View height proportional to the View width?

I'd like to set the View width into the screen width and the View height into 0.8 * View width. Is it possible to achieve this from the XML Layout?

Upvotes: 1

Views: 472

Answers (1)

Gabe Sechan
Gabe Sechan

Reputation: 93678

No, but it could easily be done by creating a custom subclass of the view you want and overriding onMeasure to return those sizes.

Upvotes: 1

Related Questions