小编Wil*_*ill的帖子

可移动的divs来自手风琴

我创建了一个弹出的sideBar.在那边sideBar我有一个包含div的手风琴.那些div是可拖的.用户可以拖动这些div并将它们定位在主页面上.

我遇到的问题是,当拖动div时,它们在手风琴之外是不可见的.这可以在视频中看到.

我可以看到它是将溢出设置为隐藏但是当我删除它时,手风琴内容会在隐藏时显示.

overflow: hidden;
Run Code Online (Sandbox Code Playgroud)

JSFiddle进一步展示我的问题.

我怎么可能解决这个/有什么可能的解决方法.

html javascript css jquery jquery-ui

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

React Bootstrap验证使用子组件中的验证输入

我正在使用react-bootstrap-validation来装饰react-bootstrap Input标签.

ValidatedInput要求它在Form组件中.当我将ValidatedInput添加到自定义子组件时,我得到一个错误,说它需要在Form中,但我想它现在在树的下方,所以无法看到Form.

有没有办法引用父窗体,以便ValidatedInput可以看到父窗体.

查看验证库的来源我可以看到ValidationInput需要注册到Form但不知道如何从子组件执行此操作.

// Parent render 
render(){
   <Form
   className="fl-form fl-form-inline fl-form-large"
   name="customer-details"
   onValidSubmit={this._handleValidSubmit}
   onInvalidSubmit={this._handleInvalidSubmit}
   validationEvent='onChange'>
    
     <TitleSelect handleChange={this.updateDropDown} value={this.state.form.title} />
     
   </form>
}


// Sub class containing the ValidatedInput
export class TitleSelect extends React.Component {

    static propTypes = {
      handleChange: React.PropTypes.func.isRequired,
      value: React.PropTypes.string.isRequired
    }

    render(){

        return (
          <ValidatedInput
            name="title"
            label='title'
            type='select'
            value={this.props.value}
            onChange={this.props.handleChange}
            groupClassName='form-group input-title'
            wrapperClassName='fl-input-wrapper'
            validate='required'
            errorHelp={{
              required: 'Please select a title.'
            }}>

            <option value="" ></option>
            <option value="Mr">Mr</option>
            <option value="Mrs">Mrs</option>
            <option value="Master">Mstr.</option>
            <option value="Ms">Ms</option>
            <option value="Miss">Miss</option>
            <option …
Run Code Online (Sandbox Code Playgroud)

reactjs react-bootstrap

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

单击UISwitch时选择UITableView的行

UITableViewUISwitchs他们在一起.

的TableView

当切换开关时,我想运行一个功能.该功能仅记录如果开关打开或关闭以及开关已更改的行.我遇到的问题是当我点击开关时它没有记录正确的行,除非我在单击开关之前点击了该行.

我想我的问题是单击开关不会选择行.如何才能选择行或者我可以将ID添加到交换机?

因此开关ID"1"为"ON".

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *CellIdentifier = @"POICell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];


    //set the cell text to the catName
    cell.textLabel.text = [self.catNames objectAtIndex:[indexPath row]];
    //add switch 
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    UISwitch *switchView = [[UISwitch alloc] initWithFrame:CGRectZero];
    cell.accessoryView = switchView;
    [switchView setOn:YES animated:NO];

    [switchView addTarget:self action:@selector(switchChanged: ) forControlEvents:UIControlEventValueChanged];
    // Configure the cell...

    return cell;
}

     - (void) switchChanged:(id)sender {
            NSString *StrCatID =[[NSString alloc]init];
            StrCatID = [self.catIDs objectAtIndex:[self.inputTableView indexPathForSelectedRow].row];
            UISwitch* …
Run Code Online (Sandbox Code Playgroud)

iphone xcode objective-c ios

5
推荐指数
4
解决办法
8003
查看次数

如何从我的iPhone App文档目录中选择所有图像

我有一个包含一堆图像的文件夹.我想将所有图像的名称添加到数组中.图像位于应用程序文档中的文件夹中.见屏幕截图.

文件目录

我知道如果我想获得其中一个图像,我将使用以下代码.

NSArray   *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString  *documentsDirectory = [paths objectAtIndex:0];
NSString  *filePath = [NSString stringWithFormat:@"%@/POIs/%@", documentsDirectory,image];
Run Code Online (Sandbox Code Playgroud)

是否可以选择文件夹中的所有文件?如果是的话,还可以选择文件的名称并将它们添加到数组中吗?

谢谢

iphone objective-c ios

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

如果电子邮件不正确,PHP邮件功能是否返回true

我正在建立一个用于从用户收集数据的系统.我知道有些会是垃圾邮件!我只是想知道如果电子邮件不正确,邮件功能是否返回false?

说我有.

   <?php

    $to = "fake@fake.com";
    $header = "From: {$to}";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";

    if (mail($to, $subject, $body, $header)) {
          echo("<p>Message successfully sent!</p>");
    } else {
          echo("<p>Message delivery failed...</p>");
    }

   ?>
Run Code Online (Sandbox Code Playgroud)

如果电子邮件不正确,将打印哪条消息?

如果确实返回false,我希望在该数据库中存储一个"标志",以便管理员可以查看并删除它.

php

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

如何在mapview中添加多个颜色图钉.

我有一张地图,有3类兴趣点.目前我已让它们显示,但它们都是相同的颜色.如何根据它们所属的类别让它们显示颜色?

我有一个搜索周围,找不到任何我能理解的应用于我的代码.

这是我当前用于注释引脚的代码:

-(void)pins:(NSString *)name lat:(NSString *)lat lon:(NSString *)lon poiID:(NSString *)poiID
{

    //cast string to float
    CGFloat Lat = (CGFloat)[lat floatValue];
    CGFloat Lon = (CGFloat)[lon floatValue];

    //Set coordinates of pin
    CLLocationCoordinate2D coordinate;
    coordinate.latitude = Lat;
    coordinate.longitude = Lon;

    //Create Pin
    MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init];
    //set details
    [annotation setCoordinate:coordinate];
    [annotation setTitle:name];
    [annotation setAccessibilityLabel:poiID]; //set the label eq to the id so we know which poi page to go to


    // Add pin to map
    [self.showMapView addAnnotation:annotation];
}

- (MKAnnotationView …
Run Code Online (Sandbox Code Playgroud)

iphone xcode objective-c ios

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

从didReceiveRemoteNotification打开视图

我问了几次这个问题,我尝试了几种不同的方法,但没有成功.

我尝试过的最新方法如​​下:我包含了我想要显示的ViewController.然后我把这个代码放在didReceiveRemoteNotification方法中.

    CarFinderViewController *pvc = [[CarFinderViewController alloc] init];
   // [self.window.rootViewController presentViewController:pvc animated:YES completion:nil];
    [(UINavigationController *)self.window.rootViewController pushViewController:pvc animated:NO];
Run Code Online (Sandbox Code Playgroud)

这没用.我认为我可能遇到的问题是我的初始视图不像许多示例所示的导航控制器.

在此输入图像描述

这是我的故事板的图片>我想发送给用户的VC是汽车发现者(右下角)

有人可以向我解释我可能做错了什么吗?

iphone xcode objective-c ios

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

IBAction按钮"无法识别的选择器发送到实例"错误

我花了一段时间在谷歌搜索这个问题的答案,并设法自己偶然发现答案,并认为我会分享它.

我收到"无法识别的选择器发送到实例"错误.我跟踪它到我的按钮.

我在实现时所做的就是为按钮分配了两种方法.我制作了一个方法并将其链接到按钮.然后我删除了该方法另外一个并将其链接到按钮.我没有意识到该按钮仍然链接,并希望运行不再存在的旧方法.

iphone xcode ios6

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

您应该使用什么而不是<CFLOGIN>

我是ColdFusion的新手,我刚读过这个帖子说有很多理由不使用cflogin

为什么人们不使用<CFLOGIN>?

我应该使用什么而不是CFlogin?

谢谢

coldfusion coldfusion-9

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

使用Jquery进行表单验证

我正在使用jQuery来验证我的表单.我想看看用户名是否只是一个单词.我在Jquery http://jqueryvalidation.org/category/selectors/中看到了选择器,但在我的情况下不知道如何使用它.

<form id="register" name="register" action="/codejudge/contest.php" method="post" >
<label for ="Username"> Username </label><br>
<input type="text" class="register-control" id="Username" name="Username"  placeholder="Enter Username"> <br><br>
<label for ="Password"> Password </label><br>
<input type="password" class="register-control" id="password" name="password" placeholder="Enter Password" ><br><br>
<label for ="Confirm-Password"> Confirm Password </label><br>
<input type="password" class="register-control" id="Confirm_Password" name="Confirm_Password" placeholder="Confirm Password" ><br><br>
<label for="email" > Email </label><br>
<input type ="email" class="register-control" id="email" name="email" placeholder="Enter Valid Email"><br><br>
<button type="submit" >Submit</button>

</form>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#register").validate({
errorElement: 'div',
rules:{ …
Run Code Online (Sandbox Code Playgroud)

html forms validation jquery

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

通过排序的字典循环无法排序.

我有一本我已经分类的字典.我的问题是当我循环它再次未分类时.

    //sort the poiIDArray so it appears alphabetically
NSArray *sortedValues = [[self.pois allValues] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
NSMutableDictionary *orderedDictionary=[[NSMutableDictionary alloc]init];
for(NSString *valor in sortedValues){
    for(NSString *clave in [self.pois allKeys]){
        if ([valor isEqualToString:[self.pois valueForKey:clave]]) {
            [orderedDictionary setValue:valor forKey:clave];
        }
    }
}

NSLog(@"ordered dic: %@",orderedDictionary);


//loop through dic and get names. 
for(NSString *key in orderedDictionary) {

    NSLog(@"%@",key);

}
Run Code Online (Sandbox Code Playgroud)

这是我的日志.

2012-10-26 11:49:35.221 CPOP Test 4[1277:c07] ordered dic: {
"Badger Burgers" = 5;
"Costa Coffee" = 4;
"Spiffing Drinks" = 6;
"Vals Vegetables" = 7;
}
2012-10-26 …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ios

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