首页 \ 问答 \ 如何在xamarin上为ios创建自定义警报视图(How to create custom alert view for ios on xamarin)

如何在xamarin上为ios创建自定义警报视图(How to create custom alert view for ios on xamarin)

我需要在C#上以编程方式为Xamarin.iOS创建自定义alertview。 警报必须包含此示例的图像。


I need to create custom alertview programmatically on C# for Xamarin.iOS on. Alert must contain image like this example. example


原文:https://stackoverflow.com/questions/39267244
更新时间:2024-02-09 15:02

最满意答案

你的循环错了 - $ columns ['EGGS']不存在:

$columns = array('EGGS', 'SALAD', 'TREES', 'REVISED');
foreach($columns as $column) {
    $$column = $columns[$column] ? 'YES' : 'NO';
}

它应该是:

$columns = array('EGGS', 'SALAD', 'TREES', 'REVISED');
foreach($columns as $column) {
    $$column = $$column ? 'YES' : 'NO';
}

或更好:

$tmp = array();
$columns = array('EGGS', 'SALAD', 'TREES', 'REVISED');
foreach($columns as $column) {
    $tmp[$column] = $$column ? 'YES' : 'NO';
}

这样你就不会覆盖你的绑定变量。

还要注意,出于性能方面的原因,您应该在while()循环之外移动该常量数组声明。


Your loop is wrong - $columns['EGGS'] doesn't exist:

$columns = array('EGGS', 'SALAD', 'TREES', 'REVISED');
foreach($columns as $column) {
    $$column = $columns[$column] ? 'YES' : 'NO';
}

it should be:

$columns = array('EGGS', 'SALAD', 'TREES', 'REVISED');
foreach($columns as $column) {
    $$column = $$column ? 'YES' : 'NO';
}

or better still:

$tmp = array();
$columns = array('EGGS', 'SALAD', 'TREES', 'REVISED');
foreach($columns as $column) {
    $tmp[$column] = $$column ? 'YES' : 'NO';
}

so that you're not over-writing your bound variables.

also note that you should move that constant array declaration outside of your while() loop for performance reasons.

相关问答

更多
  • 记录element[0].innerHTML提供:
    你的div是空的(没有#mynewid和children),因为在你请求的时候,这些元素还没有被renderHtml(content)函数创建。 例: setTimeout(function() { var myArray = document.getElementById("mynewid").children; ...
  • 首先 - 你的代码不会工作,因为这两行: foreach ($motd[] as &$value) { if ($motd['msg'] != "") { 您应该在foreach中使用$ motd,而不是$ motd [],并检查$ value ['msg'],而不是$ motd ['msg'] 其次,尝试使用mysql_fetch_assoc而不是mysql_fetch_array 第三 - $ i没有初始值。 First - your code will not work because of ...
  • 我认为你应该在PHP中获得中间元素的id,然后你可以使用一个简单的if,如下所示: 这是f:for一个扩展版本。 在这里你可以检查iteration属性。 当你使用iteration.index时,它是元素的当前索引。 但是你必须设置一个elementLimit。 它是iteration几个属性:isFirst,isLast,isEven,isOdd,total,cycle,index。 这里有一篇关于它的文章。 更新示例:
  • 我试着在本地运行你的脚本,发现了一些问题。 正如LDStewart在上述评论中指出的那样,您有点滥用$ _操作符。 其次,我无法从Get-ItemProperty创建的对象中找到名为“DisplayName”的属性,但是,有一个名为“Name”的属性,其中包含当前迭代中项目的名称。 我用这些更改更新了您的脚本,并且在我看来产生了正确的输出: $DisplayApps = @("value1", "*Value2*", "*value3*") $Apps = @("Value4") $MasterApps ...
  • 你的循环错了 - $ columns ['EGGS']不存在: $columns = array('EGGS', 'SALAD', 'TREES', 'REVISED'); foreach($columns as $column) { $$column = $columns[$column] ? 'YES' : 'NO'; } 它应该是: $columns = array('EGGS', 'SALAD', 'TREES', 'REVISED'); foreach($columns as $colu ...
  • 问题是each的返回值是迭代的数组,而不是布尔值(丢失)。 由于数组是真实的,返回delete_if值始终为true,因此将删除所有元素。 你应该改用any? : [1,2,3].delete_if do |n| ![[2,4,5], [3,6,7]].any? do |m| m.include?(n) end end #=> [2, 3] The problem is that the return value of each is the array being iterated ov ...
  • 首先,您应该对其进行分析。 我们谈论的最多只有500 * 100 = 50,000次操作。 一台普通的现代计算机能够在十分之一秒内完成它,除非你编写效率非常低。 假设你想要优化它,你应该对主数组进行排序,并对随机数组的每个元素运行二进制搜索 。 这会将操作次数从50,000减少到最多900,因为500个数字的二进制搜索最多需要9次比较。 这是一个使用标准C库的内置排序和二进制搜索功能( qsort和bsearch )的实现: int less_int(const void* left, const void ...
  • 对于轻量级方法,您可以将组合框名称放在以逗号分隔的字符串中,将字符串Split()放入数组中,然后循环遍历数组成员。 Const cstrNames As String = "cbo1,cbo4,cbo7" Dim varName As Variant For Each varName In Split(cstrNames, ",") Me.Controls(varName).Requery Next 如果要在表单中的其他过程之间共享该列表,可以将字符串设置为模块级常量,而不是在每个过程中再次声 ...
  • 我不熟悉ifort,但我认为它有一个检查数组边界的选项。 打开它。 变量更改它们的值而不实际为它们分配内容通常表示某些其他变量在其声明的边界之外被引用。 I'm not familiar with ifort, but I assume it has an option for checking array bounds. Turn it on. Variables changing their value without you actually assigning something to them a ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)