小编Lon*_*fPR的帖子

Android ScrollView是完成的吗?

只是寻找一个我在Google上找不到的简单答案.简单的说.有没有办法告诉ScrollView在投掷后何时停止滚动?

android scrollview

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

Drupal 7:以编程方式将项目添加到管理工具栏/菜单

我正在为我的公司构建一个相当复杂的模块,其中包含许多不同的配置页面.我希望在顶部的管理栏中有一个菜单项,它包含所有子菜单项.我知道如何通过UI将单个项目添加到该菜单中,但是我会更喜欢通过模块本身来完成它.那么,如何在我的模块文件的管理菜单中添加一个带有子菜单的项目,与"仪表板","内容","结构"等坐在一起.我以为它必须在hook_menu()中,但我无法弄明白.

drupal drupal-7 hook-menu drupal-modules

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

CodeIgniter:MVC和Widgets?

我是codeigniter的新手,并且使用MVC构建Web应用程序.我试图围绕如何在我的应用程序中以模块化方式实现小部件.我的问题在这一点上更具理论性.我没有显示的实际代码.

我想知道的是,我将如何构建一个数据驱动的小部件,以便我可以简单地将其放到我想要的任何页面上.例如,假设我有一个名为的小部件Widget.我创建了一个名为的模型文件/models/widget_model.php.然后我有一个名为的控制器文件/controllers/widget.php.显然,我的控制器将使用该模型从我的数据库中获取必要的数据.我不明白的是如何将其用作放在多个视图上的小部件.到目前为止,我所看到和理解的是如何使用控制器来驱动特定视图.所以它基本上就像每页使用一个控制器.我想,以模块化的方式使用这个小部件的过程是什么?

model-view-controller codeigniter

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

CodeIgniter路由不起作用

我的路线文件中有以下路由:

$route['default_controller'] = "main";
$route['404_override'] = '';
$route['testroute'] = "main";
Run Code Online (Sandbox Code Playgroud)

正如你所看到的,我想要的是当有人去mydomain.com/testroute它应该只返回默认控制器.然而,当我去那时我得到404错误.我在写这条路线的方式上做错了吗?

routes codeigniter

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

Drupal 7 Form API:基于OR而不是AND设置表单元素的可见状态

我有一个我想要显示的字段集,只有当一个选择框选择了几个选项之一时.问题是,我似乎无法看到如何工作OR.如果在数组中包含多个条件,它将像AND一样运行.我需要它才能工作,如果选择框的值例如为1 2或3.

drupal-7 drupal-forms drupal-modules

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

Sencha Touch 2:'指定商店无法找到'

我正在尝试将JSON数据加载到NestedList中.我在/app/store/Exhibits.js中有以下商店文件

Ext.define('VisitTCMIndy.store.Exhibits',{
requires: ['VisitTCMIndy.model.Exhibit', 'Ext.data.proxy.JsonP'],
extend: 'Ext.data.TreeStore',
config: {
    model: 'VisitTCMIndy.model.Exhibit',
    proxy: {
        type: 'jsonp',
        url: 'http://www.example.com/explore.php',
        reader: {
            type: 'json',
            rootPropery: 'children'
        }
    }   
}
});
Run Code Online (Sandbox Code Playgroud)

然后我在/app/view/Explore.js中的以下视图中引用它

Ext.define('VisitTCMIndy.view.Explore', {
extend: 'Ext.Container',
requires: [
    'Ext.data.TreeStore',
    'Ext.dataview.NestedList',
    'VisitTCMIndy.store.Exhibits',
],
xtype: 'explorecard',
config: {
    iconCls: 'compass1',
    title: 'Explore',
    layout: 'fit',
    items: [
        {
            xtype: 'titlebar',
            docked: 'top',
            title: 'Explore'
        },
        {
            xtype: 'nestedlist',
            fullscreen: true,
            store: 'VisitTCMIndy.store.Exhibits',
            detailCard: {
                html: 'Explore Details'
            },
            listeners: {
                leafitemtap: function(nestedList, list, index, target, record){
                    var …
Run Code Online (Sandbox Code Playgroud)

nested-lists sencha-touch-2

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

iOS:自定义表格单元格'无法识别的选择器发送到实例'

我有一个带有自定义TableViewCell的tableView.我没有使用.xib文件来解决这个问题.问题是当表应该加载时我得到以下错误:Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImage nsli_superitem]: unrecognized selector sent to instance 0x91899b0'我不确定我在这里做错了什么.这是单元格的.m文件.

#import "TCMExhibitListCell.h"

@implementation TCMExhibitListCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
    [self setListImage:[[UIImage alloc] init]];
    [self setTitleLabel:[[UILabel alloc] init]];


    NSDictionary *names = @{@"listImage" : [self listImage]};

    NSString *fmt = @"H:|-0-[listImage]";

    NSArray *imgH = [NSLayoutConstraint constraintsWithVisualFormat:fmt
                                                            options:0
                                                            metrics:nil
                                                              views:names];
    [[self contentView] addConstraints:imgH];
}
return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];

// Configure the view …
Run Code Online (Sandbox Code Playgroud)

uitableview ios

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

PHP:crypt()函数返回相同的字符串,如果基本字符串只有轻微的变化

我有使用crypt的问题.我正在为客户重建一个网站.因此,以前的版本中有很多继承的代码.我必须保持站点原始数据库,所以我必须小心我改变代码的方式.之前的开发人员使用crypt()函数创建用于存储的用户密码哈希.我看到的奇怪效果是,相同密码的轻微变化有时会创建完全相同的哈希.我不太了解地穴如何运作,但在我看来,这不应该发生.这里有一些代码作为例子.

echo crypt('Colliedog6','wfd')."\n";
echo crypt('Colliedog10','wfd')."\n";
Run Code Online (Sandbox Code Playgroud)

这将在我的服务器上返回相同的哈希字符串.我正在使用那个salt字符串,因为这是以前的开发人员使用的,所有当前的密码都是使用该salt字符串制作的,所以我真的需要使用它,除非我们想强制所有用户重置密码.这不一定是不可能的,但我们想避免它.为什么crypt会像上面那样使用两个稍微不同的字符串并创建相同的哈希?

php crypt

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

Android:TabHost将标签替换为另一个标签

我有一个包含5个标签的FragmentTabHost.其中一个加载ListFragment.单击列表中的项目时,我想将新片段加载到当前选项卡中.我似乎无法找到如何做到这一点.我唯一能做的就是用新内容发布一个全新的活动.我如何将新片段加载到活动选项卡中?

android android-fragments android-fragmentactivity fragment-tab-host

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

WordPress:functions.php中的WP_Query返回空查询(对于自定义短代码)

我正在为一个孩子主题编写一个自定义短代码,我已将其放入我的孩子主题函数.php.这是代码:

function get_featured_video(){
$video_query = new WP_Query('category_name=videos&order=ASC');
$videoPath = "/";
$videoText =  "";
while ($video_query->have_posts()){
    $video_query->the_post();
    $featured = get_post_meta($post->ID, "vid_feature", $single = true);
    if(strtolower($featured)=='yes'){
        $videoPath = get_permalink($post->ID);
        $content = strip_tags($post->post_content);
        $contentArr = str_word_count($content,1);
        if(count($contentArr>50)){
            $videoText = join(" ",array_slice($contentArr,0,50));
            $videoText .= " <a href='$link'>&lt;read more&gt;</a>";
        } else {
            $videoText = $content;
        }
        break;
    }
}
$returnStr = "<h1><a href='$videoPath'>You've Got to See This!</a></h1>\n";
$returnStr .= $videoText;
return $returnStr;
}

add_shortcode('getfeaturedvideo','get_featured_video');
Run Code Online (Sandbox Code Playgroud)

我遇到的问题是它返回一个空白查询.我知道视频类别中有一个帖子.我从未在functions.php中使用过WP_Query.我需要使用不同的方法吗?

wordpress shortcode

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

ios:UIAlertView在循环执行之前立即显示

我有以下代码:

 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Loading Content For the First Time..."
                                                   message:@"\n"
                                                  delegate:self
                                         cancelButtonTitle:nil
                                         otherButtonTitles:nil];

            UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
            spinner.center = CGPointMake(139.5, 75.5); // .5 so it doesn't blur
            [alertView addSubview:spinner];
            [spinner startAnimating];
            [alertView show];

            for (TCMLevelRemote *level in [obj objectForKey:@"levels"]){
                [[TCMExhibitFeedStore sharedStore] createLevel:level];
            }
            [[TCMExhibitFeedStore sharedStore] loadAllLevels];
            [[TCMExhibitFeedStore sharedStore] setAllLevels:[[TCMExhibitFeedStore sharedStore] storedLevels]];
            [alertView dismissWithClickedButtonIndex:0 animated:YES];
Run Code Online (Sandbox Code Playgroud)

for循环需要一段时间才能执行,因为它会在应用程序第一次运行时下载一些信息.因此,我希望此通知显示,以便用户不会坐在无响应的屏幕上等待.问题是在for循环结束之前,alertview不会显示.然后它马上就消失了.我需要改变什么?

uialertview ios

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