- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
您好,我目前正在构建一个闪存卡生产力应用程序,它具有我制作的用户控件。在制作控件时,我意识到它太小而无法在我的手机显示屏上很好地显示或呈现。因此,我开始通过增加控件的宽度和高度以及增加用户控件中包含的所有控件的文本大小来扩大用户控件。只有当我尝试运行控件时,才会出现此异常:SuperCards.exe 中出现“Windows.UI.Xaml.Markup.XamlParseException”类型的异常,但未在用户代码中处理
WinRT 信息:无法从文本“%0”创建“%1”。 [行:12 位置:48]
附加信息:找不到与此错误代码关联的文本。
这是用户控件的 xaml 代码:
<UserControl
x:Class="SuperCards.CardPackItemListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SuperCards"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="125"
d:DesignWidth="400" >
<Border CornerRadius="2" BorderThickness="1" BorderBrush="White">
<Grid Background="White" Height="Auto" Width=" Auto">
<TextBlock x:Name="cardPackItemNameDisplay" HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto" Height="Auto" Text="(Sample) Periodic Table" Foreground="Gray" Margin="9,9,0,0" FontSize="30" />
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="9,30,9,9" Width="Auto" Height="9" Background="gray" >
<Rectangle HorizontalAlignment="Left" VerticalAlignment="Stretch" Fill="Red" Width="46"/>
</Grid>
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Top" Text="36" Foreground="Gray" Margin="0,9,9,0" FontSize="30"/>
</Grid>
</Border>
此时,visual studios 通知用户控件的构造函数内的初始化组件未处理异常。
最佳答案
第 12 行的以下属性与错误消息中的行相对应;删除引号内的前导空格:
Width=" Auto"
如果 WinRT 中的颜色名称区分大小写,这也可能会导致问题;最好将 Gray
中的 G
大写以防万一:
Background="gray"
关于c# - 扩大控制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27297468/
有人可以解释一下为什么您会使用扩大或缩小转换吗?我已经阅读了很多关于这些的内容,但没有人给我一个实际的例子。谢谢! 最佳答案 (Java) 扩大和缩小转换与相关类型之间的转换有关。以抽象(超)类与其(
假设我有一个接口(interface): public interface FooInterface { public void someMethod(); } 我有一个实现这
我正在尝试用 ocaml 编写一个免费的 monad 库,关注 Control.Monad.Free来自haskell,但我在执行hoistFree 时陷入了困境。 hoistFree :: Func
我有这样的数据。每行代表该 ID 在某个日期的一个值。 ID Date Value A 2012-01-05 50 A 2012-01-08 100 A
我正在开发一个可以扩展/收缩的 SwiftUI List 单元,这是一个非常简单的东西,您可以在很多上下文中看到。类似于以下内容(以下内容在 UIKit 中实现): 说实话,我正在努力在 SwiftU
http://jsfiddle.net/bzL7p87k/ 我在这个表中有占位符,他们用特殊的词填充,但是当我有超过 4 行时怎么办?当我有 21 行的 21 个占位符时? 我的意思是:我只有一行与占
我需要在我的 Zoul 项目中使用一个库,它广泛使用 malloc 机制来分配动态内存。 问题是当这个库调用 malloc 时它返回 NULL 因为堆中没有足够的内存。 我试过这个简单的函数来查看程序
使用 bootstrap 4.0.0,我有以下代码: Title text text text Click me ... repeated many t
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 8 年前。 Improve this q
我有一个 TextView,我在其中设置了 HTML 文本。这篇文章有很多链接。当您点击一个链接时,它并不总是触发 onClick 方法。因此,我正在尝试扩展 ClickableSpan 的区域,以便
在 WPF 中,当用户将焦点放在 TextBox 中时,我想要一些动画,使 TextBox 变为多行并使其 Width 变大(在他打字时),当失去焦点时,TextBox 恢复到原来的大小。 大小未知。
我想在目录中搜索与任何单词列表匹配的任何文件。如果文件匹配,我想将该文件复制到一个新目录中。我创建了一小批测试文件并使以下代码正常工作: cp `grep -lir 'word\|word2\|wor
我有一个布局,左侧是图像,右侧是文本内容。我希望图像具有 100% 的高度,并且我希望保持图像的纵横比。文本内容应填充可用宽度。 我尝试使用 flex-box,但是图像 flex 元素不会根据图像大小
我使用 JHChainableAnimations增大(缩放) View 设置一个新值,然后再次将 View 缩小(缩放)到其原始大小。 我尝试过: var isGrowing = true
我不确定其他人是否会有这种奇怪的愿望,也就是说我意识到这可能是一个不寻常的请求。 我想采用顶部示例中的内容,并让它在除数“:”字符上自动变为“居中对齐”。 这是 Xcode 扩展程序可以编写的程序吗?
我正在为网站创建一个简单的 2 列布局,但遇到了一些问题。当我向应用了 float:left 的列添加填充时, float 会扩展超过我定义的宽度。我似乎无法在任何地方找到这个问题的答案。 最佳答案
我得到了一个组织为 的图片库.所有图像都在 元素,当我将鼠标移到其中一张图片上时,它应该会增长以向用户提供视觉反馈。问题是,当我只是使用 animate() 更改图像的大小时,其他图片将被推到一边,
我正在尝试放大最居中的 ListView 项目。 (最终,我希望将其扩展为一种简单轻巧的3D效果,元素在屏幕中间时会放大,在下方时会缩小,全黑背景和文本项放大和缩小……) 所以,我制作了一个虚拟 Li
我有一个 canvas,我希望它是 100% 屏幕宽度和至少 100% 屏幕高度,但如果以下 div 超出底部屏幕。 我正在使用 Trianglify 填充 Canvas 。 var patt
我很难以我很容易理解的方式找到关于这个主题的信息,所以我要求对我找到的内容进行审查。这都是关于转换和转换的。 在例子中我将提到: (signed/unsigned) int bigger; (sign
我是一名优秀的程序员,十分优秀!