简体   繁体   中英

Android .axml intellisense not working with support library controls

I'm currently using VS2013/VS2015 with Xamarin.Android - I'd like to be able to edit layout .axml files with Android intellisense. I use the Automatic editor selector(XML) to edit files. My problem is that while the default Android controls display intellisense fine, as soon as I use a support lib control (like android.support.v7.widget.Toolbar it breaks intellisense for the file (not just the Toolbar control).

For example with the following code, intellisense works fine until I add in the support lib Toolbar:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
    a:orientation="vertical"
    a:layout_height="wrap_content"
    a:layout_width="fill_parent">
    <android.support.v7.widget.Toolbar xmlns:local="http://schemas.android.com/apk/res-auto"
        a:id="@+id/Routes_Add_SegmentList_Toolbar"
        a:layout_width="match_parent"
        a:layout_height="wrap_content"
        a:minHeight="?attr/actionBarSize"
        a:background="?attr/colorPrimary"
        local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        local:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
    <FrameLayout
        a:layout_height="wrap_content"
        a:layout_width="fill_parent"
        a:layout_marginTop="16dp">
        <ImageView
            a:layout_marginLeft="16dp"
            a:scaleType="fitCenter"
            a:layout_gravity="left|center_vertical"
            a:src="@drawable/start_pin"
            a:layout_height="40dp"
            a:layout_width="40dp" />
        <EditText
            a:layout_marginLeft="50dp"
            a:layout_marginRight="16dp"
            a:id="@+id/Routes_Add_SegmentList_StartSegment"
            a:layout_height="wrap_content"
            a:layout_width="fill_parent" />
    </FrameLayout>
</LinearLayout>

Is there any way to add another xml schema or similar so that it can properly handle non-default android controls? Thanks!

Try

  • Navigate to root of your solution
  • Delete .vs folder (hidden folder)
  • Restart VS
  • Open solution
  • Open .axml file

Try and share your thoughts if that works or not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM