我希望我的 Xamarin Android 应用程序支持 API 级别 16 及更高级别。但我对 Visual Studio 的属性窗格中存在三种不同的版本设置感到困惑。
属性的名称是
Compile using Android version
Minimum Android to target
Target Android version
我得到的最低限度。应该是 16。但是另外两个呢?
简单的答案
让所有三个设置具有相同的值:
Set Compile using Android version
to 具有您需要的所有功能的版本.
Set Mininum Android to target
to 使用使用SDK版本编译.
Set Target Android version
to 使用使用SDK版本编译.
不太简单的答案
如果您想使用较新的功能但仍向后兼容:
Set Compile using Android version
to 具有您需要的所有功能的版本.
Set Mininum Android to target
to 您想要支持的最低版本.
Set Target Android version
to 使用使用SDK版本编译.
在您的代码中,您必须确保应用程序也适用于最低版本:
if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Honeycomb)
{
// Do modern stuff.
}
else
{
// Do it the old-fashioned way.
}
在这里阅读更多详细信息:http://redth.codes/such-android-api-levels-much-confuse-wow/ http://redth.codes/such-android-api-levels-much-confuse-wow/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)