Unexpected namespace prefix “app” found for tag RelativeLayout - Android?

后端 未结 7 2262
走了就别回头了
走了就别回头了 2021-02-13 04:46

I need to use BottomSheetBehavior with ScrollView but it says to me :

Unexpected namespace prefix \"app\" found for tag RelativeLayout
         


        
7条回答
  •  温柔的废话
    2021-02-13 05:28

    Try setting your xmlns namespace once in the parent layout if you are going to use it multiple times.

    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    

    Writing this declaration once in your parent CoordinatorLayout will suffice.

    Hint: When using multiple layouts and views, try to implement the attribute. It will make your code clean and easily readable.

提交回复
热议问题