在我的项目中,我使用JTRevealSideBar来显示边桌UI,但是当我将iPad/iPhone从纵向模式更改为横向模式时,UI会受到干扰 http://screencast.com/t/EDi8xbsvV
- (CGRect)applicationViewFrame {
CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
CGRect expectedFrame = [self.view convertRect:appFrame fromView:nil];
return expectedFrame;
Run Code Online (Sandbox Code Playgroud)
}
- (UIView *)viewForLeftSidebar {
CGRect mainFrame = [self.navigationController applicationViewFrame];
if (!self.leftSidebarViewController) {
SP2SideBarViewController * sideController = [[SP2SideBarViewController alloc] initWithStyle:UITableViewStylePlain];
self.leftSidebarViewController = sideController;
[sideController release];
self.leftSidebarViewController.sidebarDelegate = self;
if ( self.callerAppName )
[self.leftSidebarViewController setLaunchAppName:self.callerAppName];
if ([UIHelper isPad]) {
self.leftSidebarViewController.view.frame = CGRectMake(0, mainFrame.origin.y, SIDEBAR_IPAD_WIDTH, mainFrame.size.height);
} else {
self.leftSidebarViewController.view.frame = CGRectMake(0, mainFrame.origin.y, 170, mainFrame.size.height);
}
self.leftSidebarViewController.title = @"LeftSidebarViewController";
self.leftSidebarViewController.view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | …Run Code Online (Sandbox Code Playgroud) 我想在我的项目中添加第6个标签栏.当我为此尝试时,我会获得更多选项,但是当我点击更多选项卡时,没有任何反应.为我提供这个以及任何其他逻辑的良好解决方案.
我必须创建一个视图,我必须在iOS项目中打开.svg扩展文件.我对此.svg扩展有一些疑问
我想扩展UITableView我必须展示的部分UITableViewCells.我该怎么做才能做到这一点?
我在iOS sdk中从plist获取id值,如果我获得值0,那么我必须将其显示为1,反之亦然.
这是我的相同代码
+(BOOL) removeButton {
id obj = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"ABC"];
if (obj != Nil) {
return (BOOL)obj;
}
return YES;
}
Run Code Online (Sandbox Code Playgroud)
但问题是,当id的值为0时,它将返回No,反之亦然.但是我想把我的条件放在相反的事情上,比如假设id的值是0然后我必须显示返回YES,反之亦然.
我在我的数组中添加对象时发生错误 - [__ NSArrayI addObjectsFromArray:]:无法识别的选择器发送到实例0xa0c5f70
id max;
NSMutableArray * MovePointsArray=[[NSMutableArray alloc]init];
max=[pointsArray objectAtIndex:0];
for(int i=0;i<[pointsArray count];i++){
if ([pointsArray objectAtIndex:i] > max) {
max=[pointsArray objectAtIndex:i];
[MovePointsArray addObject:max];
}
}
NSMutableArray * pointArray =[NSArray arrayWithObjects: [pointsArray objectAtIndex:0],[pointsArray lastObject], nil];
[pointArray addObjectsFromArray:MovePointsArray];
Run Code Online (Sandbox Code Playgroud)
没有得到我,我做错了.

在上面的图像中有一条白线,我想只在每个角度为圆圈中的这个图像设置动画.假设我的角度是20度,那么白线在58度内动画,它将像下面的图像一样

她是我的代码
UIImageView *imgBenchmark = [[UIImageView alloc]initWithFrame:CGRectMake(153,70, 1, 26)];
self.benchmark = imgBenchmark;
[imgBenchmark release];
self.benchmark.layer.anchorPoint = CGPointMake(self.benchmark.layer.anchorPoint.x, self.benchmark.layer.anchorPoint.y*2);
self.benchmark.backgroundColor = [UIColor clearColor];
self.benchmark.image = [UIImage imageNamed:@"line.png"];
[self.view addSubview:self.benchmark];
[self rotateIt1:20];
-(void) rotateIt1:(float)angl
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.01f];
[self.benchmark setTransform: CGAffineTransformMakeRotation((M_PI / 9) *angl)];
[UIView commitAnimations];
}
Run Code Online (Sandbox Code Playgroud) 我的 iPhone 应用程序崩溃并显示错误:
- [__NSCFDictionary stringByReplacingOccurrencesOfString:withString:]: unrecognized selector sent to instance 0x99f60b0
这是我的代码 NSString *strData; AppDelegate *委托=(AppDelegate *)[[UIApplication共享应用]委托]; if (delegate.respondInsightIndex) { strData = [见解 objectAtIndex:index]; } else { strData = [insights lastObject];
}
NSString *strReplace = [NSString stringWithFormat:@"%@",[strData stringByReplacingOccurrencesOfString:@"%20" withString:@" "]];
Run Code Online (Sandbox Code Playgroud)
这是我的方法,崩溃再次发生
- (void) setComments:(NSArray*)comments {
NSString * htmlString;
if ( [UIHelper isPad] )
htmlString = @"<html><style type=\"text/css\">body{padding:15px 40px 0 40px; font-family: Helvetica;"
"font-size: 14px;"
"color: #888888;"
"line-height: 50%"
"},</style><body>";
else
htmlString = @"<html><style type=\"text/css\">body{padding:8px 20px 0 20px; font-family: Helvetica;" …Run Code Online (Sandbox Code Playgroud) 在我的iPhone应用程序中,我正在尝试将背景图像设置为UISearch Bar,我的图像未显示.
这是我的代码
UISearchBar * tempSearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake( 0, 0, self.view.bounds.size.width, 40 )];
self.searchBar = tempSearchBar;
tempSearchBar.delegate = self;
self.searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
self.searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone;
self.searchBar.barStyle = UIBarStyleBlack;
self.searchBar.backgroundColor=[UIColor clearColor];
self.searchBar.backgroundImage=[UIImage imageNamed:@"Searchbox.png"];
self.searchBar.placeholder = @"Search My Data";
[self.searchBar sizeToFit];
[self.view addSubview:self.searchBar];
[tempSearchBar release];
Run Code Online (Sandbox Code Playgroud) ios ×8
uiimageview ×2
angle ×1
animation ×1
background ×1
boolean ×1
ios6.1 ×1
ipad ×1
iphone ×1
orientation ×1
string ×1
uisearchbar ×1
uitabbar ×1
uitableview ×1