小编Bob*_*obi的帖子

iOS 7 UIStatusBarStyle在应用程序启动错误期间隐藏状态栏

我正在更新我的应用程序以将导航栏的颜色从白色更改为蓝色.因此,我想将状态栏的颜色从黑色更改为白色.我已经尝试了Apple文档中的所有内容,这有助于我在Storyboard中更改所有View控制器的状态栏样式.

但是,我推到的任何笔尖都不在我的故事板中,使用presentViewController会自动更改UIStatusBarStyle - 这是我的推送代码:

NSString *url = @"https://twitter.com/Example";
                NSString *title = @"Example";
SocialWebViewController *addController = [[[SocialWebViewController alloc] initWithURL:url title:title] initWithNibName:@"SocialWebView_iPhone" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addController];
[self presentViewController:navigationController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

我已经在我的AppDelegate中放置了UIStatusBar首选样式,这对我的StoryBoard中的ViewControllers起作用,但是只有:

- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}
Run Code Online (Sandbox Code Playgroud)

是的,我已经尝试过了:

(1) [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];

(2) [self setNeedsStatusBarAppearanceUpdate];

(3)在plist中将UIViewControllerBasedStatusBarAppearance设置为YES

没有这个适用于那些不在我的StoryBoard中的笔尖.

确定所以我想出你所说的是什么 - 设置查看基于控制器的状态栏外观"否"不是为我工作因为我的状态栏在应用程序启动期间一直隐藏,因为我在设置时一直隐藏它UIViewControllerBasedStatusBarAppearance为"NO"...我该如何解决这个问题?

objective-c statusbar uinavigationcontroller ios

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

asp c中的结构化数据JSON ld#

我期待通过json ld将结构数据脚本添加到ac#asp.net web应用程序.

这是我想要添加的结构化数据脚本.由于@与c#的冲突,我收到运行时错误The name 'context' does not exist in the current context...这显然是由于@语法冲突造成的.

什么是解决这个问题的简单方法?

<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "LegalService",
"image": "https://example.com.png",
"@id": "https://example.com",
"name": "Example Name",
"description": "Example description.",
"address": {
"@type": "PostalAddress",
"streetAddress": "Example Address",
"addressLocality": "Example City",
"addressRegion": "Example State",
"postalCode": "Example Postal",
"addressCountry": "Example Country"
},
"url": "https://example.com",
"telephone": "Example number",
"sameAs": [
"example social account 1",
"example social account 2"
]
}
</script>
Run Code Online (Sandbox Code Playgroud)

所以看起来围绕这个方式,感谢@scartag,是添加一个双@.

我也试图在脚本中添加一个循环,但是我遇到了运行时错误.我不确定这是否可行.它适用于将在CMS中生成的博客文章.

见下文:

<script type="application/ld+json">
{
  "@@context": "http://schema.org",
  "@@type": …
Run Code Online (Sandbox Code Playgroud)

c# json

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

Web.config iis url重写

我正在尝试添加一个iis url重写规则,该规则在开发环境(在我的本地计算机上)上有所不同,并且一旦上传到服务器并发布(部署).

我的IIS重写规则有效,但我不想记得在localhost部署网站后更改为我的服务器托管地址.有什么建议?

下面是我的IIS URL重写规则 <system.webServer>

<!-- IIS Rules Rewrite -->
<rewrite>
  <rules>  
<!-- Serve site map with proper XML content type response header. -->
    <rule name="Sitemap XML" enabled="true" stopProcessing="true">
      <match url="sitemap.xml" />
      <action type="Rewrite" url="sitemap.aspx" appendQueryString="false"/>
    </rule>
    <!-- Access block rule - is used to block all requests made to a Web site if those requests do not have the host header set. This type of rule is useful when you want to prevent hacking attempts that …
Run Code Online (Sandbox Code Playgroud)

c# asp.net iis visual-studio

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