iPhone NavigationBar / ToolBar on Android
Recently, I've been wo开发者_如何学JAVArking on an iphone app, and I would now like to port it to Android, for a broader distribution. Could anybody suggest me some way to "port" (to keep those functionalities in an Android-friendly interface, perhaps) the iPhone App Navigation Bar and Toolbars?
I wrote a blog post about using XML layouts to build something like the iPhone UIToolbar.
To summarise. Create a fixed height, RelativeLayout. Set up your buttons as ImageButtons in the relative layout. Use a style to define your RelativeLayout Toolbar and ImageButton toolbar buttons. Use drawables to give those toolbar elements the appropriate gradient.
When porting across mobile platforms, especially the iPhone-Android pair, don't port layouts and widgets literally. Use the most native to the targeted platform look and feel, and achieve resemblance to the original only by similar graphics, color schemes, etc. One of the most annoying things to users are the attempts to achieve full clone of the original version over the targeted one. One of the worst examples is the iPhone navigation bar, ported to Android app with the back button disabled, yuck.
Check out this presentation from Google I/O this year: http://www.google.com/events/io/2010/sessions/android-ui-design-patterns.html
It specifically describes a number of UI design patterns for navigating within apps.
It's an old post, but something new arrived in Android world :
The wonderful android UI guide
Which must be readen by every Android developpers, and every people who want to port an app from another platform to Android.
For your problem, if your are still interested in, you can read this specific part : action bars
精彩评论