【发布时间】:2015-05-07 00:57:27
【问题描述】:
我目前正在使用带有 Xamarin.Android 的 VS2013/VS2015 - 我希望能够使用 Android 智能感知编辑布局 .axml 文件。我使用自动编辑器选择器(XML)来编辑文件。我的问题是,虽然默认的 Android 控件可以正常显示智能感知,但只要我使用支持库控件(如 android.support.v7.widget.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>
有没有办法添加另一个 xml 架构或类似的架构,以便它可以正确处理非默认的 android 控件?谢谢!
【问题讨论】:
-
你找到解决方案了吗?
-
不幸的是,到目前为止一无所获:(
-
正在等待关于此的任何内容。。到此日期为止,它无法正常工作。
-
我对 Visual 2015 更新 2 和最新的 Xamarin.Android 6.1.071 有同样的问题。有什么解决办法吗?
-
还是没有解决办法?
标签: android visual-studio android-layout xamarin intellisense