我注意到titleView的位置取决于右侧按钮标题.如何将titleView的框架设置为居中?
我试过设置titleView.frame,但无济于事.
这是代码:
UIButton *titleLabel = [UIButton buttonWithType:UIButtonTypeCustom];
[titleLabel setTitle:@"Right Eye" forState:UIControlStateNormal];
[titleLabel setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[titleLabel setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted];
titleLabel.frame = CGRectMake(100, 0, 180, 44);
titleLabel.titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.titleLabel.font = [UIFont boldSystemFontOfSize:20.0];
titleLabel.titleLabel.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.3];
// titleLabel.titleLabel.textAlignment = UITextAlignmentCenter; (this doesn't work either)
[titleLabel addTarget:self action:@selector(titleTap:) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.titleView = titleLabel;
self.navigationItem.titleView.frame = CGRectMake(100, 0, 180, 44); //(this doesn't work either)
Run Code Online (Sandbox Code Playgroud)
一直试图用easy_install或pip安装psycopg2,终端卡在xcrun和lipo之间的循环中.
sidwyn$ sudo easy_install psycopg2
Searching for psycopg2
Reading https://pypi.python.org/simple/psycopg2/
Reading http://initd.org/psycopg/
Reading http://initd.org/projects/psycopg2
Best match: psycopg2 2.5.1
Downloading https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.1.tar.gz#md5=1b433f83d50d1bc61e09026e906d84c7
Processing psycopg2-2.5.1.tar.gz
Writing /tmp/easy_install-dTk7cd/psycopg2-2.5.1/setup.cfg
Running psycopg2-2.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-dTk7cd/psycopg2-2.5.1/egg-dist-tmp-4jaXas
clang: warning: argument unused during compilation: '-mno-fused-madd'
Run Code Online (Sandbox Code Playgroud)
它在xcrun和lipo之间反弹,并永远停留在这个循环中.希望对此有一些见解.
我是OS X Mavericks 10.9,最新版本.
一直在线查看崩溃报告,这似乎是主要问题.
知道它指的是什么吗?(图形太多,图形太重等)
奇怪的是,我没有在模拟器或设备上发生任何崩溃.
Crash log:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0x33bd52d4 __kill + 8
1 libSystem.B.dylib 0x33bd52c4 *_kill
2 libSystem.B.dylib 0x33bd52b6 raise
3 libSystem.B.dylib 0x33be9d72 abort
4 libstdc++.6.dylib 0x31bdba20 __gnu_cxx::__verbose_terminate_handler() + 376
5 libobjc.A.dylib 0x3347c594 _objc_terminate
6 libstdc++.6.dylib 0x31bd9df2 __cxxabiv1::__terminate(void (*)()) + 46
7 libstdc++.6.dylib 0x31bd9e46 std::terminate() + 10
8 libstdc++.6.dylib 0x31bd9f16 __cxa_throw + 78
9 libobjc.A.dylib 0x3347b4c4 objc_exception_throw
10 Foundation 0x33639910 __NSThreadPerformPerform
11 CoreFoundation 0x33a767d6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
12 CoreFoundation …
Run Code Online (Sandbox Code Playgroud) 底线是,我一直工作在一个应用程序,它似乎是,如果我把一个UIAlert
在viewDidLoad
,它被称为两次(从的委托方法UIImagePickerController
).如果我把它放入viewDidAppear
,它会被调用一次.
我查看了文档,但它让我很困惑.
我一直在关注这个快速入门:https://devcenter.heroku.com/articles/getting-started-with-python
但是想知道如何让'heroku local'与python 3.5.1一起运行?我已经更改了runtime.txt以将其设置为python 3.5.1,但它仍然会加载2.7的依赖项.
谢谢!
每次我尝试从数学导入时都会崩溃.有没有办法重新安装数学库?我在使用Python 3.3.2.
sidwyn$ python3
>>> from math import pi
Segmentation fault: 11
Run Code Online (Sandbox Code Playgroud) 我似乎在这里实现了所有正确的代码.我的代码中是否缺少某些内容?
//
// ScrollyiPadViewController.m
// ScrollyiPad
//
// Created by Sidwyn Koh on 5/19/10.
// Copyright __MyCompanyName__ 2010. All rights reserved.
//
#import "ScrollyiPadViewController.h"
@implementation ScrollyiPadViewController
-(void)viewDidLoad{
[self.view addSubview:scrollView];
[scrollView addSubview:imageView];
UIImage *image = [UIImage imageNamed:@"hardware-01-20100127.jpg"];
scrollView.contentSize = [image size];
scrollView.maximumZoomScale = 2.0;
// scrollView.delegate = self;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{
return imageView;
}
/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle …
Run Code Online (Sandbox Code Playgroud) 我的应用程序需要很长时间才能加载,我不知道为什么.添加:在实际调出Default@2x.png之前,它会在主屏幕上停留3-4秒.
点击图标时有人能告诉我装的是什么吗?它是applicationDidFinishLaunching方法吗?还是资源?
我已经尝试过Debug&Release&Distribution,甚至在设备上测试过,看起来Default@2x.png似乎都出现了.但是,如果我从App Store进行全新安装,则会显示Default.png.
我也尝试过多次清理,重建,删除和放置Default@2x.png,但仍然会出现同样的错误.我甚至在评论笔记中写道,Apple要检查但是他们没有回复(我猜他们错过了).这里发生了什么事?
谢谢.
iphone ×8
python ×3
launch ×2
default ×1
graphics ×1
heroku ×1
ios ×1
lipo ×1
nsarray ×1
objective-c ×1
psycopg2 ×1
python-3.3 ×1
sql-server ×1
uiscrollview ×1
viewdidload ×1
xcode ×1