Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/190.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 基于自定义属性的buildType的命名空间_Android_Android Studio_Android Layout_Xamarin_Android Xml - Fatal编程技术网

Android 基于自定义属性的buildType的命名空间

Android 基于自定义属性的buildType的命名空间,android,android-studio,android-layout,xamarin,android-xml,Android,Android Studio,Android Layout,Xamarin,Android Xml,对于调试和发布构建类型,我有单独的包名。从Android文档中,我们知道定制属性可以通过提供名称空间在XML布局中使用。名称空间看起来像:http://schemas.android.com/apk/res/[您的软件包名称]: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:custom="http://schemas.android.com/

对于调试和发布构建类型,我有单独的包名。从Android文档中,我们知道定制属性可以通过提供名称空间在XML布局中使用。名称空间看起来像:
http://schemas.android.com/apk/res/[您的软件包名称]

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:custom="http://schemas.android.com/apk/res/[your package name]">

  <com.example.customviews.charting.PieChart
     custom:showText="true"
     custom:labelPosition="left" />

</LinearLayout>


基于buildType,如何构造名称空间以使其引用当前包名?它可能是Strings.xml res中定义的字符串,然后这个布局从那里引用它吗?可以基于当前包名动态创建名称空间吗?

您可以尝试通过Android>Properties>Android Manifest>package name构建名称空间。@WendyZang MSFT您能详细说明一下吗?我不知道你的意思。感谢我上面提到的更改名称空间的包名的方法。