How can I create a widget layout compatible with all display and any density ? Thanks
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That isn’t really possible using one file.
The best option to use is to create one layout, then create one style file. Then in the style place styles for the elements in your layout. Then you can create a dimens file in layout-small, layout-normal, layout-large, layout-xlarge. Here you can place display size related dimensions in density independant measurements, such as dp and sp.
Then of course, you will need to do the whole song and dance with creating drawables for all various densities.