小编Tit*_*eul的帖子

如何在Sencha touch 2.1中创建复杂的数据项目?

我想在列表中创建dataitem,如下所示: 所需的布局

但我无法vbox使用3个组件渲染中间部分.我是按照这个例子:http://www.sencha.com/blog/dive-into-dataview-with-sencha-touch-2-beta-2/

这就是我定义数据项的方式:

Ext.define('MyTabApp.view.CartListItem', {
    extend  : 'Ext.dataview.component.DataItem',
    alias   : 'widget.cartlistitem',
    requires: [
               'Ext.Img'
    ],
    config  : {
        cls: 'cart-list-item',
        layout: {
            type: 'hbox',
            align: 'center'
        },
        image: true,
        details: {
            cls: 'x-details',
            flex: 3,
        },
        pricing: {
            cls: 'x-pricing',
            flex: 1
        },
        removeButton: {
            iconCls     : 'delete',
            iconMask    : true,
            ui          : 'astonvilla',
            style       : 'margin-left: 5px; margin-top:10px; padding:5px;'
        },
        moveButton: {
            iconCls     : 'reply',
            iconMask    : true,
            ui          : 'astonvilla',
            style       : 'margin-left: …
Run Code Online (Sandbox Code Playgroud)

javascript sencha-touch sencha-touch-2 sencha-touch-2.1

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

在横向模式下呈现时,UIViewController无法正确显示

我的应用程序支持纵向和横向方向.我使用以下代码从位于UITabBarController中的UIViewController以模态方式呈现UIViewController:

self.modalViewController = [[ModalViewController alloc] init];

[self presentViewController:self.modalViewController animated:YES completion:^{

}];
Run Code Online (Sandbox Code Playgroud)

ModalViewController是一个控制器,只能由Landscape中的用户看到.它应该能够从LandscapeRight旋转到LandscapeLeft.这是它的样子:

@implementation ModalViewController

#pragma mark - UIViewController - Orientation

- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

- (BOOL)shouldAutorotate
{
    return YES;
}

#pragma mark - NSObject

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor greenColor];
}

#pragma mark - UIViewController - Status Bar

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

@end
Run Code Online (Sandbox Code Playgroud)

控制器从左侧向上滑动,并在95%的时间内完全覆盖屏幕.但有5%的时间,它从底部向上滑动,仅覆盖屏幕的上半部分.

以下是它工作正常时的样子:

在此输入图像描述

这是它在不能正常工作时的样子:

在此输入图像描述

我创建了一个示例项目,可以在这里找到:https://github.com/TitouanVanBelle/Bug

有一个UI测试目标,以帮助重现该问题,但它很少有效.

有谁知道为什么会这样?

objective-c uiviewcontroller ios

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

"语句需要表达整数类型"错误,包含switch语句和字符串数组

尝试使用数组,但它在switch语句中给出了"语句需要表达整数类型('id'无效)".怎么了?

NSArray count = [NSArray arrayWithObjects: @"1", @"2", @"3", @"4", @"5", @"6", @"7", nil];    

switch ([count objectAtIndex: myIndex]) {
    case 1:
        NSLog(@"One");
        break;
    case 2:
        NSLog(@"Two");
        break;
    case 3:
        NSLog(@"Three");
        break;
    default:
        break;
}
Run Code Online (Sandbox Code Playgroud)

iphone objective-c

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

使用"已注册"属性呈现Facebook好友

在我看来,我想做的是:

  • 获取当前用户的Facebook好友
  • 渲染此集合,而区分谁是加入了"注册"属性设置为我的应用到其他用户已经注册的用户truefalse该集合的每个项目

我已成功检索当前用户的Facebook好友并将其提供给我的应用程序

UserController的

  def facebook_friends
    @friends = graph.get_connections("me", "friends")
  end
Run Code Online (Sandbox Code Playgroud)

Rabl的

object false
node :data do @friends
end
Run Code Online (Sandbox Code Playgroud)

它返回如下内容:

{
  data: [{
    'id': '23456789'
    'name': 'Bobby Brown'
  }, {
    'id': '23456788'
    'name': 'Bobby Black'
  }]
}
Run Code Online (Sandbox Code Playgroud)

但我想要的是这样的:

{
  data: [{
    'id': '23456789'
    'name': 'Bobby Brown',
    'registered': true
  }, {
    'id': '23456788'
    'name': 'Bobby Black',
    'registered': false
  }]
}
Run Code Online (Sandbox Code Playgroud)

但我不知道如何在不浪费太多资源的情况下完成第二部分.

facebook ruby-on-rails koala rabl

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

在iOS上,我如何水平移动navigationItem.leftBarButtonItem?

一个cusomized UINavigationBar要求我提供一个定制的"后退"按钮,我使用navigationItem.leftBarButtonItem = myCustomizedButton,但它的位置是固定的.

有人愿意分享如何将这个按钮40像素移到右边?

customization uinavigationbar ios

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

收到致命警报:handshake_failure

我正在尝试使用liferay中的javapns库向我的设备发送推送通知.这是代码:

private void pushNotification(ActionRequest actionRequest,
            ActionResponse actionResponse) {

        try {
            System.out.println("Push");

            Push.alert("Hello World!", "ck.p12", "PASSPHRASE", false, "TOKEN");

        } catch (CommunicationException e) {
            System.out.println("CommunicationException");
            e.printStackTrace();
        } catch (KeystoreException e) {
            System.out.println("KeystoreException");
            e.printStackTrace();
        }

    }
Run Code Online (Sandbox Code Playgroud)

调用pushNotification时出现此错误:

ERROR [PushNotificationManager:450] Delivery error: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
Run Code Online (Sandbox Code Playgroud)

我用谷歌搜索但找不到任何解决方案.

有谁知道如何解决这个问题?

java liferay push-notification

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

如何在PostgreSQL中声明变量

我尝试在这样的代码中声明一个变量,但它不起作用.你能告诉我这是什么问题吗?

ERROR:  syntax error at or near "VARCHAR"
LINE 2:  p_country VARCHAR;


DECLARE
    p_country VARCHAR;
 p_country : = ''; 
SELECT p_country; 
Run Code Online (Sandbox Code Playgroud)

postgresql

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

在库中选择视频

任何人都可以告诉我是否有办法通过PhoneGap从库中选择视频.如果是这样,使用什么版本的PhoneGap.

我试图像处理图片一样,但图片中没有显示视频.

(不要指出这篇文章:这不是我想要的)

谢谢

android ios cordova

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

Sencha Touch当前工作目录(/Developer/SDKs/MacOSX10.6.sdk/sencha-touch-2.1.0)不是公认的Sencha SDK或应用程序文件夹

我已经在/Developer/SDKs/MacOSX10.6.sdk下安装了sencha-touch-2.1.0-gpl和sencha SDK工具.,在Temrinal中浏览到文件夹sencha-touch-2.1.0-gpl并给出命令sencha导致警告

[WARN] The current working directory (/Developer/SDKs/MacOSX10.6.sdk/sencha-touch-2.1.0) is not a recognized Sencha SDK or application folder. Running in backwards compatible mode.
Run Code Online (Sandbox Code Playgroud)

有什么建议 !!??谢谢

extjs sencha-touch sencha-touch-2 sencha-architect

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

`build':执行rails时ExceptionNotifier:Module(NoMethodError)的未定义方法`new'

我刚刚升级到Mac OSX Mavericks和Ruby 1.9.3-p392,现在当我尝试在我的rails s一个应用程序中运行时,出现以下错误:

=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:43:in `build': undefined method `new' for ExceptionNotifier:Module (NoMethodError)
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `block in build'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `each'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `inject'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.13/lib/action_dispatch/middleware/stack.rb:113:in `build'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/engine.rb:470:in `app'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/titouanvanbelle/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application.rb:136:in …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails-3.2

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