Reputation: 1505
I have a custom drop-down navigation ActionBar spinner and it works pretty well. Only problem is, the width of the dropdown menu is always the same as that of the spinner. Since the text in the spinner changes according to content, it sometimes gets ridiculously thin, which as demonstrated below, can be a problem...
I know that it's possible to set a dropdown width for spinners, but this isn't a regular spinner, it's not actually in the xml because it's a sub-view of the ActionBar. Is there a way to interact with that view directly to set a width to the dropdown? Is there another way to make the dropdown conform to the actual text in it? Thanks in advance.
Upvotes: 0
Views: 1302
Reputation: 1505
Oddly enough, this was solved the moment I changed the dropdown resource conatiner from a RelativeLayout to a LinearLayout. Specifically, it's the fact that the text was aligned to the left of the imagebutton that broke the design. The moment I disabled that alignment or changed the entire thing to a linear layout, it started adjusting to the content's width.
Upvotes: 3