最近android很火,老能看到新闻,咱也得与时俱进一下,按照官方文档学习了下,发现运行HelloTabWidget这个例子时报错,Google了一下,发现这个问题历史挺悠久的,目前按照
[url]http://developer.android.com/resources/tutorials/views/hello-tabwidget.html[/url]来做,需要做如下即可运行正常:
1、在res.draw下面添加:
xml内容参照ic_tab_artists.xml
2、修改AndroidManifest.xml
这个文档做了说明,但很含糊
[url]http://developer.android.com/resources/tutorials/views/hello-tabwidget.html[/url]来做,需要做如下即可运行正常:
1、在res.draw下面添加:
ic_tab_artists.xml
ic_tab_artists_grey.png
ic_tab_artists_white.png
ic_tab_songs.xml
ic_tab_songs_white.png
ic_tab_songs_grey.png
xml内容参照ic_tab_artists.xml
2、修改AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloandroid"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloTabWidget"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AlbumsActivity" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".ArtistsActivity" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".SongsActivity" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
</application>
</manifest>
这个文档做了说明,但很含糊