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

后端 未结 7 2279
走了就别回头了
走了就别回头了 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:13

    This issue is well known in while using data-binding in a layout.

    Assume you want to use some data binding attribute with app: prefix then just adding xmlns:app... will not be enough. layout should be data binding layout wrapped with tag.

    Incorrect Approach:

    e.g. I imported layout_toolbar_default.xml and using app:toolbarTitle to specify title.

    
    
    
        
    
    
    

    This will show error Unexpected namespace prefix "app" found.

    Solution:

    Wrap your layout with tag because you are using binding attribute.

    
    
    
        
    
            
    
        
    
    

提交回复
热议问题