Is it possible to assign a widget width to half the available screen width, and do it using declarative xml?
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.
If your widget is a Button:
I’m assuming you want your widget to take up one half, and another widget to take up the other half. The trick is using a LinearLayout, setting
layout_width="fill_parent"on both widgets, and settinglayout_weightto the same value on both widgets as well. If there are two widgets, both with the same weight, the LinearLayout will split the width between the two widgets.