小编hel*_*rld的帖子

应用程序图标未显示在 iPhone 上 - Xcode 9.1

应用程序上的 iOS 部署目标是 11.1,添加图标后,我注意到该图标没有显示。我在这里看到了关于 SO 的其他帖子,似乎向图像添加个人资料有帮助,但它对我没有帮助。

在此输入图像描述

在此输入图像描述

在此输入图像描述

我在这里错过了什么吗?

iphone xcode ios

3
推荐指数
1
解决办法
8619
查看次数

使用 Nokogiri 替换标签 - 更快的方法?

我在一个名为的变量中有以下 HTML,html_data我希望<img><a>标签替换标签,并且src“img”标签的参数变为href“a”标签。

现有的 HTML:

<!DOCTYPE html>
<html>
   <head>
      <title>Learning Nokogiri</title>
   </head>
   <body marginwidth="6">
      <div valign="top">
         <div class="some_class">
            <div class="test">
               <img src="apple.png" alt="Apple" height="42" width="42">
               <div style="white-space: pre-wrap;"></div>
            </div>
         </div>
      </div>
   </body>
</html>
Run Code Online (Sandbox Code Playgroud)

这是我的解决方案A:

nokogiri_html = Nokogiri::HTML(html_data)
nokogiri_html("img").each { |tag|
        a_tag = Nokogiri::XML::Node.new("a", nokogiri_html)
        a_tag["href"] = tag["src"]
        tag.add_next_sibling(a_tag)
        tag.remove()
}

puts 'nokogiri_html is', nokogiri_html
Run Code Online (Sandbox Code Playgroud)

这是我的解决方案B:

nokogiri_html = Nokogiri::HTML(html_data)
nokogiri_html("img").each { |tag|
        tag.name= "a";
        tag.set_attribute("href" , tag["src"])
}

puts 'nokogiri_html is', nokogiri_html …
Run Code Online (Sandbox Code Playgroud)

html css ruby nokogiri

1
推荐指数
1
解决办法
1963
查看次数

标签 统计

css ×1

html ×1

ios ×1

iphone ×1

nokogiri ×1

ruby ×1

xcode ×1