小编Kin*_*gon的帖子

Bootstrap:仅在较大的屏幕中显示固定页脚?

我现在是Bootstrap(3.3.4)的新手,我似乎对我的发布网站的页脚位置有问题.我只希望将页脚固定在较大的屏幕(平板电脑和计算机)上,而不是移动设备.

由于Bootstrap现在是移动优先的,我没有在我的css代码中明确声明我的页脚的位置样式(因为我不想修复它),除了我更大的屏幕媒体查询:

/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */

/* Small devices (tablets, 768px and up) */
@media (min-width: @screen-sm-min) {

  /* Pull out the header and footer */
  .mastfoot {
    position: fixed;
    bottom: 0;
  }

}

/* Medium devices (desktops, 992px and up) */
@media (min-width: @screen-md-min) {

  /* Pull out the header and footer */
  .mastfoot {
    position: fixed;
    bottom: 0;
  }
}

/* …
Run Code Online (Sandbox Code Playgroud)

html css less twitter-bootstrap css-preprocessor

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

Firebase安全规则?

我似乎很难使用firebase安全规则.我已经阅读了这些指南,但模拟器的结果不够具有描述性(如果我们可以将鼠标悬停在某个节点上,并且弹出一个可以更新规则的按钮,则会更容易).

这是我的结构:

chats
  - randomChatId01
    - name: "awesome chat"
    - members:
        - userId01 : true
        - userId02 : true
  - randomChatId02
    - members:
        - userId02 : true
  - randomChatId03
    - members:
        - userId01 : true
        - userId02 : true
  - ...
Run Code Online (Sandbox Code Playgroud)

我只希望用户能够读取节点的子节点成员包含经过身份验证的用户的auth.uid的聊天节点.

因此,在这种情况下,如果userId01已登录,则她只能读取randomChatId01randomChatId03的读取权限.

这是我的规则:

{
    "rules": {

        "chats": {

          "$chat": {
            ".read": "data.child('members').val().contains(auth.uid)"
          }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

然而,它在模拟器中返回以下内容:

Attempt to read /chats with auth={"provider":"anonymous","uid":"eF4ztDEXz7"}
    /
    /chats

No .read rule allowed …
Run Code Online (Sandbox Code Playgroud)

json node.js firebase firebase-security firebase-authentication

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

如何在右侧和左侧对齐页脚文本?

我正在尝试对齐页脚左侧和右侧的文本.问题是右边的文字在左边的文本下面一行.我希望他们在同一条线上.任何帮助,将不胜感激!谢谢您的帮助!

这是我的代码:http://jsfiddle.net/kc6AL/

HTML

<!--Footerline-->
<div id="footerline">
<img src="http://s21.postimg.org/l6t6akypj/line.jpg"/>
</div>
<!--Footer-->
<div id="footer">
<h3 class="copyright">Copyright Stuff.</h3>
<h3 class="social">Social Links.</h3>
Run Code Online (Sandbox Code Playgroud)

CSS

#footerline {
    width: 100%;
    overflow: hidden;
    margin: 5px auto 10px auto;
    text-align: center;
}

#footer {
    max-width: 980px;
    text-align: center;
    margin: auto;
}

h3 {

font-family: 'Source Sans Pro', sans-serif;
            text-transform:uppercase;
            font-weight : 300;
            font-size : 14px;
            color : #000;

}

.copyright {

    text-align: left;
}

.social {

    text-align: right;

}
Run Code Online (Sandbox Code Playgroud)

html css

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

iOS:使用在后台运行的方法进行For循环?

我有一个id的数组,我在其中运行for循环,并调用在后台运行的方法(进行网络调用以获取数据).我如何知道for循环何时完成以及所有调用都已完成?

目前,for循环在所有预期的呼叫完成之前完成.我应该使用while循环吗?

更新(终于搞定了!)

我在这里发布了我的代码,希望它能帮助别人.:)

详细信息:根据Andrey的建议,我做的第一件事是继承NSOperation并执行以下操作:

@interface AsyncOperation ()

@property (atomic, assign) BOOL _executing;
@property (atomic, assign) BOOL _finished;

@end

@implementation AsyncOperation

- (void)start {

    if ([self isCancelled]) {

        //Move the operation to the finished state if it is canceled.
        [self willChangeValueForKey:@"isFinished"];
        self._finished = YES;
        [self didChangeValueForKey:@"isFinished"];
        return;
    }

    //If the operation is not canceled, begin executing the task.
    [self willChangeValueForKey:@"isExecuting"];
    [NSThread detachNewThreadSelector:@selector(main) toTarget:self withObject:nil];
    self._executing = YES;
    [self didChangeValueForKey:@"isExecuting"];

}

- (void)main {
    if ([self isCancelled]) {
        return; …
Run Code Online (Sandbox Code Playgroud)

for-loop objective-c ios objective-c-blocks

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

检查NSUserDefaults中是否存在用户名?

我目前想检查NSUserDefaults中是否存在用户名,如果不存在我想加载模态视图控制器.问题是即使用户名为nil,它仍然表现得好像存在.这就是我所拥有的:

//Check if the login data exists
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if ([defaults objectForKey:@"username"] != nil) {

        //Load Login View if no username is found
        NSLog(@"No username found");
        LoginViewController *loginView = [[LoginViewController alloc] init];
        [self presentViewController:loginView animated:YES completion:nil];
    }

    else {

        NSString *savedUsername = [defaults stringForKey:@"username"];
        NSLog(@"Username found: %@", savedUsername);

    }
Run Code Online (Sandbox Code Playgroud)

我一直在我的NSLog中得到这个: Username found: (null)

任何帮助,将不胜感激!

iphone if-statement objective-c nsuserdefaults ios

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

在MPMoviePlayerViewController中自定义两个UISliders?

我目前正在尝试在MPMoviePlayerViewController中自定义几个东西,但我遇到了其中一个滑块的问题.

如下所示,它具有2个滑块,一个音量滑块和一个小持续时间滑块.

通过使用以下内容: UIImage *thumbImage = [UIImage imageNamed:@"MPThumbSelected.png"]; [[UISlider appearance] setThumbImage:thumbImage forState:UIControlStateNormal];

我可以自定义每个滑块,包括音量滑块,但由于某种原因,导航栏中较小的滑块不会更新.有没有人有什么建议?任何帮助将不胜感激!谢谢!!

在此输入图像描述

objective-c uislider ios uiappearance

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