If yours is MyCustomViewalways greater than the width of the screen, then it is safe to set the width HorizontalScrollViewequal to its contents. Try the following:
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:fillViewport="true"
>
<com.mina.demo.customwidgets.MyCustomView
android:layout_width="wrap_content"
android:layout_height="50dp"
/>
</HorizontalScrollView>
, , HorizontalScrollView fill_parent. , , .