How to make Andorid's ActionBar/TabWidget LinearLayout to wrap it's children
问题 I try to implement the scrollable tabs where each tab has it's size adjusted to it's content size. I tried two approaches: ActionBar and TabHost. In both cases I was able to adjust tabs sizes. To achieve that I setLayoutProperites on each Tab after given Tab was added. In both cases the same approach. The weight is changed to 0 and width is set to WRAP_CONTENT. Below the TabHost related example. LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) tabHost.getTabWidget()