创建图像的 9patch png 版本。这是只有某些区域可以拉伸的图像。android SDK中有一个工具看看。(您需要使箭头左侧的区域成为唯一延伸的部分)。
然后使用一个框架布局,里面有两个Layouts;一个用于亮蓝色背景,一个用于指针。例如:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width/height/ect...>
<LinearLayout android:id="BlueBackground"
android:background="brightblue"
android:layout_width/height/ect.../>
<LinearLayout android:id="Pointer"
android:background="pointer9patch"
android:layout_width/height/ect...>
//The List
</LinearLayout>
</FrameLayout>
编辑:
如果您希望指针菜单只占用屏幕的某个部分,您可以使用水平线性布局将屏幕一分为二:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width/height/ect...>
<ImageView android:id="BlueBackground"
android:layout_width/height/ect...>
<LinearLayout android:id="HSplitLayout"
orientation="horizontal">
<LinearLayout android:id="Pointer"
android:layout_width/height/ect...>
//The List
</LinearLayout>
<ContentOnRight...>
</LinearLayout>
</FrameLayout>