English 中文(简体)
我能否把我的风格放在不同的组合名称中?
原标题:Can I place my Android styles in different package names?

例如,I参比和roid风格与......

@android:style/... 

和我自己的风格......

@style/...

但是,我如何把我的风格与其他名字组合分开? e.g.

@somePackage:style/...
最佳回答

不幸的是,你可以 t。 你可能认为,英国图书馆可以帮助你,但情况并非如此。 这是因为,在汇编资源时,图书馆被“实际”并入主要应用程序。

因此,从<代码>apt的角度来看,你的应用资源与任何其他英属图书馆资源是不可分割的。 更有甚者,<代码>apt作为投入获得多个资源名录(即申请使用途径res,加上所有<代码>res名录>的途径,但与此同时,只有单一<代码>AndroidManifest.xml作为这些资源的“所有者”通过。

我要说的是,即使你能够将资源(例如风格)归入单独的图书馆,但你仍然能够使用这些图书馆的组合名称提及这些资源。 只有在使用主要的成套应用名称的情况下才能使用。


例如,你有成套名称:com.test.app和安德罗图书馆com.test.lib/code>。 图书馆的风格是testStyle

以下不做的工作(从理论上讲,没有什么东西可以帮助你完成这一工作):

<TextView style="@com.test.lib:style/testStyle" .../>

虽然这部法律对:

<TextView style="@com.test.app:style/testStyle" .../>
问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...