解决方案 »

  1.   

    这个有点儿意思。
    想到一种比较变态的做法,做两个drawable,一个叫pointer,代表上面那个指针;一个叫ruler,代表下面的刻度,想要多少刻度,ruler就做多长,然后用下面这种布局试试。    <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:orientation="vertical" >        <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/pointer" />        <ScrollView
                android:id="@+id/scroller"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" >            <View
                    android:background="@drawable/ruler"
                    android:layout_width="1000dp"
                    android:layout_height="40dp" />
            </ScrollView>
        </LinearLayout>想要获取刻度的时候,需要根据scroller的scroll offset计算一下
      

  2.   

    如果要实现红色的指针覆盖在刻度上面,需要把外层的LinearLayout换成RelativeLayout,然后让Pointer盖在Ruler上面就行了