我已經定義了一個模塊在下面的風格,我想使用它作爲一個主題上的活動如何使用IntelliJ引用在Android模塊中定義的樣式?
的Android模塊的styles.xml:
<resources>
<style name="MyTheme" parent="android:Theme.Light.Panel"></style>
</resources>
Android應用程序的AndroidManifest.xml:
<activity android:name="MyActivity" android:theme="@style/MyTheme"> ... </activity>
我使用的IntelliJ ,我得到的編譯錯誤說
android-apt-compiler: AndroidManifest.xml:26: error: Error: No resource found that matches the given name (at 'theme' with value '@style/MyTheme').
我如何引用在我的主應用程序模塊的jar中的樣式?
謝謝。
你應該使用模塊依賴而不是jar依賴,你的主應用程序應該依賴於定義樣式的庫模塊。 – CrazyCoder
我想分發我創建的JAR。是否有可能使用其中定義的資源? –
請[請檢查此帖](http://devmaze.wordpress.com/2011/05/22/android-application-android-libraries-and-jar-libraries/)。 Android庫和jar庫的主要區別在於後者不能包含資源(如樣式)。 – CrazyCoder