这应该很简单.
我有一个带有TableView的iPhone应用程序.如何将小经典箭头添加到每个单元格的右侧?
我非常喜欢iOS 7中后退按钮箭头的形状,并希望在我的一个UIButtons上使用它,但是喜欢>而不是<.是否有文字方式,或者我应该只使用图像?
我在导航栏上有一个UIBarButtonItem.我想把它做成箭头形状.我的意思是我希望它是正方形,除了尖尖的一面.有谁知道如何做到这一点?
谢谢!
我需要在我的应用程序中添加一个左侧栏按钮项,看起来像系统后退按钮,但不是系统后退按钮,因为它将出现在视图控制器上,这是我的navController堆栈的唯一vc并执行我自己的代码.简单地写"Back"对我来说并不是很好,因为我还需要显示"<"箭头.有没有办法以编程方式创建这样的箭头,而不用该箭头制作图像?

我有一个带有NavigationBar的UIView,我想添加一个看起来像后退按钮样式的按钮.我没有使用UINavigationController,并想知道如果没有它可以完成吗?
按钮的样式应如下所示: 
谢谢
iphone objective-c back-button uinavigationbar uinavigationcontroller
我已经尝试了几天了.我正在创建一个sprite表加载器,但是我也必须能够加载面向相反方向的sprite.这涉及翻转我已经加载的图像.
我已经尝试使用UIImageOrientation/UIImageOrientationUpMirrored方法执行此操作,但这绝对没有任何效果,只需绘制与之前完全相同的方向框架.
从那时起,我尝试了一种稍微复杂的方式,我将在下面介绍.但仍然只是以与加载到应用程序中完全相同的方式绘制图像.(没有镜像).
我已经包含了下面的方法(以及我的评论,以便你可以按照我的思维模式),你能看到我做错了吗?
- (UIImage*) getFlippedFrame:(UIImage*) imageToFlip
{
//create a context to draw that shizz into
UIGraphicsBeginImageContext(imageToFlip.size);
CGContextRef currentContext = UIGraphicsGetCurrentContext();
//WHERE YOU LEFT OFF. you're attempting to find a way to flip the image in imagetoflip. and return it as a new UIimage. But no luck so far.
[imageToFlip drawInRect:CGRectMake(0, 0, imageToFlip.size.width, imageToFlip.size.height)];
//take the current context with the old frame drawn in and flip it.
CGContextScaleCTM(currentContext, -1.0, 1.0);
//create a UIImage made from the flipped context. However …Run Code Online (Sandbox Code Playgroud) 关于这个问题:如何从子视图控制器中更改后退按钮文本?我正在寻找一种方法来更改后退按钮标题后刷新导航栏previousViewController.navigationItem.backBarButtonItem?.title = "New Title".
来自链接问题的(不太理想?)解决方案:
if let navigationController = self.navigationController {
navigationController.popViewControllerAnimated(false)
navigationController.pushViewController(self, animated: false)
}
Run Code Online (Sandbox Code Playgroud)
编辑:
显然,更改图层框会强制导航栏刷新.我认为不是解决方案,而是更便宜的(?)解决方法:
if let navigationController = self.navigationController {
navigationController.navigationBar.layer.frame.insetInPlace(dx: 0.1, dy: 0)
navigationController.navigationBar.layer.frame.insetInPlace(dx: -0.1, dy: 0)
}
Run Code Online (Sandbox Code Playgroud) 我一直在尝试创建一个导航栏后退按钮.
这是我的代码: -
UIBarButtonItem *barButton = [[[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self action:nil]autorelease];
self.navigationItem.rightBarButtonItem = barButton;
Run Code Online (Sandbox Code Playgroud)
但它没有在导航栏上显示任何内容.
我使用的是UIViewController,而不是UINavigationController.
UINavigationController是实现这一目标的唯一方法吗?
任何帮助将非常感激.
任何好教程的链接都会很棒.
谢谢.
我通过推送其表视图单元从另一个视图控制器启动viewController.现在在第二个视图控制器上,我有一大堆控件主要是测试字段.我想通过使用第二个视图控制器中提供的默认后退按钮,所以它将是第一个视图控制器的标题,并记住像我说的默认,所以我不想创建自己的按钮返回在第二个视图控制器上.因此,想要检测第二个视图控制器是退出还是消失或将消失,并且基于某些条件阻止它返回到原始调用者视图控制器.我最初认为它可以在这里完成:
-(void) viewWillDisappear:(BOOL)animated {
if ([self.navigationController.viewControllers indexOfObject:self]==NSNotFound)
{
// So back button was pressed on the second view controller, so how do I stop it
// here from going back to the original view controller.
}
}
Run Code Online (Sandbox Code Playgroud)
或者我该怎么做?我似乎无法找到一个视图控制器返回类型BOOL方法来调用和停止它.
谢谢.
嗨我在导航栏上显示UIBarButton作为后退按钮,我怎么能有UIButton的默认后退按钮样式.
问候萨姆.
我想改变我的UINavigationBar的后退按钮
我可以使用此代码执行此操作:
// Set the custom back button
UIImage *buttonImage = [UIImage imageNamed:@"backag.png"];
//create the button and assign the image
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:buttonImage forState:UIControlStateNormal];
[button setImage:[UIImage imageNamed:@"selback.png"] forState:UIControlStateHighlighted];
button.adjustsImageWhenDisabled = NO;
//set the frame of the button to the size of the image (see note below)
button.frame = CGRectMake(0, 0, 30, 30);
[button addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
//create a UIBarButtonItem with the button as a custom view
UIBarButtonItem *customBarItem = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.leftBarButtonItem = customBarItem;
self.navigationItem.hidesBackButton …Run Code Online (Sandbox Code Playgroud) iphone ×9
ios ×7
cocoa-touch ×3
objective-c ×3
back-button ×2
cocoa ×1
ios5 ×1
swift ×1
uibutton ×1
uitableview ×1
unicode ×1
xcode ×1
xcode4.3 ×1