小编Nis*_*shi的帖子

在iPhone和iPad上,横向模式下无法正确显示JTRevealSideBar UI

在我的项目中,我使用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)

orientation ipad ios6.1

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

我们可以在ios sdk中添加五个以上的标签栏吗?

我想在我的项目中添加第6个标签栏.当我为此尝试时,我会获得更多选项,但是当我点击更多选项卡时,没有任何反应.为我提供这个以及任何其他逻辑的良好解决方案.

uitabbarcontroller uitabbar ios

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

如何在iOS中打开.svg文件?

我必须创建一个视图,我必须在iOS项目中打开.svg扩展文件.我对此.svg扩展有一些疑问

  1. 我们可以直接在iOS中打开.svf文件,如.png或任何其他图片吗?
  2. 或者我们必须使用任何不同的东西来打开这个文件.

ios

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

想要扩展和折叠UITableview部分

我想扩展UITableView我必须展示的部分UITableViewCells.我该怎么做才能做到这一点?

uitableview ios

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

想在iOS sdk中反转BOOL值

我在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,反之亦然.

boolean ios

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

获取 - [__ NSArrayI addObjectsFromArray:]:无法识别的选择器发送到实例0xa0c5f70错误

我在我的数组中添加对象时发生错误 - [__ 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)

没有得到我,我做错了.

iphone nsmutablearray ios

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

我想按照角度在iOS中旋转图像

http://screencast.com/t/OAb6BDNgiK

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

http://screencast.com/t/xuzngv8gRY

她是我的代码

 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)

animation angle uiimageview ios

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

我的 iPhone 应用程序崩溃并显示 [__NSCFDictionary stringByReplacingOccurrencesOfString:withString:]: 无法识别的选择器发送到实例

我的 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)

string ios

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

我正在尝试将背景图像设置为UISearchBar,但背景图像未在我的iPhone应用程序中显示

在我的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)

background uiimageview uisearchbar ios

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