开发者

How to port Iphone style app into Android?

first, please see the blog as the link showed below:

http://blogs.nitobi.com/joe/2008/10/17/phonegap-now-for-android/comment-page-1/#comment-12918

the author made iPhone Style app in Android emulator, the pic showed below:

http: blogs.nitobi.com/joe/wp-content/uploads/2008/10/droidgap.png

if anyone knows, Would you please tell me how to make the iphone sytle app in android, as the pic shows? I checked the phonegap demo in the github, it's not the same as the picture showed in the blog.

I am so curious about how can make iphone style app in Android? Since it need the Iphone OS to display such effect. Would anyone please tell me how to make it?

so pity that the link doesn't work now: https: github.com/bowserj/gap/

your reply will be great appriciated. the same question i asked can be found with link: http: stackoverflow.com/questions/2786787/how-to-implement-iphone-titlebar-in-android

only to synic:

hi, synic, thanks to your great reply.

to your second note, because i find i didn't add a picture in my first question thread, but your suggestion is great.

to your example titlebar, the code is great, but i'd like to use opensource webapp-ui-framework like Phonegap, iqtouch, iui, which is more powerful and reusable, don't think so?

i can use iui or jqtouch, to make a fancy UI, by combining html into android's WebView api, but the problem is, i need use Safari to display the html, otherwise, it will not have the iPhone fancy tiltebar and the beautiful iPhone style, Safari has a engine to display such effect, which android OS may not have. So how can i find a library or jar file, which can subtitute this Safari engine and can be used in Android OS, Android emulator开发者_StackOverflow中文版?

If there's no way, It's very pitiful and poor that Android UI developer had to create html with the standard iPhone style manualy , comparing to iPhone developer which can use existing iWebKit/iUi/jqtouch Webapp-UI-FrameWork, only to type simple tag such as titlebar leftnav, then the framework will to do the work to display the iPhone Style titlebar... OMG, too unfair.

If you suggest me to develop UI with Android API as you metioned above, yeah, it's ok to me, but it will make me uncomfortable that the Android api is so poor and inconvinient, leading much trouble, comparing with webapp-UI-framework i mentioned


The Android UI is very customizable.. it's kind of like HTML and CSS.

You can set a background image for every view, override the default images for every view, etc. He's probably just set custom background images for the layout at the top, and the buttons. It'd be pretty easy to do something like this.

An example titlebar, assuming you have the images:

<LinearLayout android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/iphone_titlebar">

    <Button android:id="@+id/back"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Main"
        android:textColor="#fff"
        android:background="@drawable/iphone_back" />

    <TextView android:id="@+id/title_text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="center_horizontal"
        android:textColor="#fff"
        android:textStyle="bold"
        android:text="Geo Location"/>
 </LinearLayout>

Relevant links:

  • https://developer.android.com/guide/topics/ui/themes.html
  • https://developer.android.com/studio/write/draw9patch.html

On another note, it really just looks like he took a screenshot of something, and pasted it over a screenshot of the Android emulator. That whole image is weird as hell.

An another another note, if you already asked this question, why are you asking it again? It looks like someone already answered it. Did you not like his answer?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜