How to develop this Menu (on the picture)
There is a question. How to develop this kind of menu (see below on the picture).
The picture
I am interested in technique. IOW the idea, classes, dodgy things. I don开发者_如何学C't want to get the working code but the idea how to develop that.
Thank you in advance...
Try this out. I use it on my app.
http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
If you would like an implementation check out this solution. I've used it and it works great http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
That looks like it's a LinearLayout with that nice background that gives it the drop shadow and ballon-point. Then there are just ImageButtons inside, sitting on top of the background image in the linear layout. The actual linear layout is a little larger than the background image which allows the background image to define the shape of the container and make it look more custom - Nice technique...
The hard part is implementing it. Overlaying it onto the activity in the right spots. For this, you would maybe wrap it into an AbsoluteLayout, and work with the AbsoluteLayout in your code to overlay it in the right place.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="300px"
android:id="@+id/parent_one"
android:layout_height="80px"
android:src="@drawable/NICE_BACLKGROUND">
<ImageButton
android:layout_width="75px"
android:layout_height="47px"
android:layout_marginLeft="10px"
android:src="@drawable/button1">
</ImageButton>
<ImageButton
android:id="@+id/btnGoTo"
android:layout_width="75px"
android:layout_height="47px"
android:src="@drawable/button2">
</ImageButton>
<ImageButton
android:id="@+id/btnSaveAn"
android:layout_width="75px"
android:layout_height="47px"
android:src="@drawable/save_to_dash">
</ImageButton>
<ImageButton
android:id="@+id/btnClear"
android:layout_width="75px"
android:layout_height="47px"
android:src="@drawable/clear">
</ImageButton>
<ImageButton
android:id="@+id/btnSaveAnd"
android:layout_width="75px"
android:layout_height="47px"
android:src="@drawable/save_to">
</ImageButton>
<ImageButton
android:id="@+id/btnClear"
android:layout_width="75px"
android:layout_height="47px"
android:src="@drawable/clear">
</ImageButton>
</LinearLayout>
Simple use Quick Action Dialog on long press.
精彩评论