I’ve been digging around for a while about this issue. In my layout, I have a textview. How do I make the width of my textview’s width half of the screen’s physical width? Can I do it in the xml layout directly or I should have a function in the java code,which gets the physical size and set the textview’s size one half of that?
I don’t care abou the resolution.
Thanks in advance!
You should use the layout_wheight attribute for yout TextView:
Use the same property (and same weight) on the layout you want to place on the side of your TextView, they will have both the same size = 1/2 of your physical screen.