Today, after attempting to customize a control, the error is used in the layout file
<relativelayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Xmlns:tools= "Http://schemas.android.com/tools"
xmlns:carrey= "Http://schemas.android.com/apk/res/com.example.customview"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:paddingbottom= "@dimen/activity_vertical_margin"
android:paddingleft= "@dimen/activity_horizontal_margin"
android:paddingright= "@dimen/activity_horizontal_margin"
android:paddingtop= "@dimen/activity_vertical_margin"
Tools:context= ". Mainactivity ">
<com.carrey.customview.customview
Android:id= "@+id/customview"
Android:layout_width= "200DP"
android:layout_height= "200DP"
Android:layout_centerinparent= "true"
Android:background= "#FFD700"
Carrey:imagealpha= "0.5"
Carrey:imageaspectratio= "1.0"
Carrey:imagepaddingbottom= "5DP"
carrey:imagepaddingleft= "5DP"
carrey:imagepaddingright= "5DP"
carrey:imagepaddingtop= "5DP"
Carrey:imagescaletype= "Center"
carrey:imagesrc= "@drawable/b_fuzhuang01"
Carrey:subtitlepaddingbottom= "3DP"
carrey:subtitlepaddingleft= "3DP"
carrey:subtitlepaddingright= "3DP"
carrey:subtitlepaddingtop= "3DP"
Carrey:subtitletext= "This is level two sub-title"
Carrey:subtitletextcolor= "#00FF7F"
Carrey:subtitletextsize= "20SP"
Carrey:titlepaddingbottom= "4DP"
carrey:titlepaddingleft= "4DP"
carrey:titlepaddingright= "4DP"
carrey:titlepaddingtop= "4DP"
Carrey:titletext= "This is a headline"
Carrey:titletextcolor= "#1E90FF"
Carrey:titletextsize= "30sp"/>
</RelativeLayout>
Tip Error Error:error parsing xml:not well-formed (invalid token) at the time of the package name referencing the custom control. Tangled for a long time to solve. There may be two reasons, one is xmlns:carrey= "Http://schemas.android.com/apk/res/com.example.customview" The package name has a problem, The package name here must be the package name in the configuration file. Another possibility is that there is a problem with the format or coding, when there is a problem with the format, even if the package name is correct, it will not find a specific error point. At this point you need to format, Ctrl+shift+f is a formatted shortcut key. My problem is to solve this, record it.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Questions about the Error:error parsing Xml:not well-formed (invalid token) error when you use a custom control in a layout file