this is a known bug that has never been solved: (https://code.google.com/p/android/issues/detail?id=20088), but here is the code that worked for me. the trick is to set the horizontal scroll view's width to wrap content and the width of the linear (or relative) layout below it to match parent .
<HorizontalScrollView android:id="@+id/group_scroller" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <RadioGroup android:id="@+id/choices_group" android:layout_width="wrap_content" android:orientation="horizontal" android:paddingTop="4dp" android:paddingBottom="4dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" /> </LinearLayout> </HorizontalScrollView>