我正在更新我的应用程序以使用iOS 7,我遇到了表视图的问题.我的标签栏是半透明的.问题是当我滚动到表格视图的底部时,最后一个单元格的一部分仍然位于标签栏的后面.我想在最后一个单元格和标签栏之间留出一点空间.我可以通过使用不透明的标签栏来解决这个问题,但我想让它保持半透明.

我刚刚向我的应用添加了推送通知.我想要这样,当用户从通知中打开应用程序时,它将打开一个特定的视图控制器,而不是我的rootViewController.这是我的AppDelegate:
#import "KFBAppDelegate.h"
#import "KFBViewController.h"
#import "AboutUs.h"
#import "ContactUs.h"
#import "KYFB.h"
#import "KFBNavControllerViewController.h"
#import "KFBTabBarViewController.h"
#import "RSFM.h"
#import "LegislatorInfo.h"
#import "Events.h"
#import "ActionAlertsViewController.h"
#import "UAirship.h"
#import "UAPush.h"
#import "UAAnalytics.h"
@implementation KFBAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// This prevents the UA Library from registering with UIApplcation by default when
// registerForRemoteNotifications is called. This will allow you to prompt your
// users at a later time. This gives your app the opportunity to explain the benefits
// of push …Run Code Online (Sandbox Code Playgroud) 我可以使用IB_DESIGNABLE和/或IBInspectable在Interface Builder中设置layer.borderWidth和layer.borderColor吗?我目前正在代码中创建我的按钮,但我希望能够在IB中设置所有这些,但我不确定这些属性是否可以在Xcode 6中设置.我想将它设置为IBOutlet而不是在代码中设置所有这些.这是我的按钮代码.
directions = [UIButton buttonWithType:UIButtonTypeRoundedRect];
directions.titleLabel.textAlignment = NSTextAlignmentCenter;
directions.titleLabel.font = [UIFont fontWithName:@"FranklinGothicStd-ExtraCond" size:20.0];
[directions setTitle:@"Directions" forState:UIControlStateNormal];
[directions setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
directions.frame = CGRectMake(20, 178, 70, 70);
directions.layer.borderWidth = 2.0f;
directions.layer.borderColor = [UIColor whiteColor].CGColor;
directions.clipsToBounds = YES;
directions.backgroundColor = [UIColor clearColor];
[directions addTarget:self action:@selector(getDirections:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:directions];
Run Code Online (Sandbox Code Playgroud)

我按照建议设置了这些值,并且模拟器中从不显示边框.编辑:我发现为什么在IB中设置这些值时边框没有显示出来.边框颜色是CGColor,所以我必须在代码中设置它.

我在我的MKMapView上有一个UISearchBar,我将用它来搜索注释.我无法取消取消按钮.我在viewDidLoad方法中创建搜索栏,如下所示:
UISearchBar *searchBar = [[UISearchBar alloc] init];
searchBar.frame = CGRectMake(0, 0, 320,44);
searchBar.showsBookmarkButton = NO;
searchBar.showsCancelButton = YES;
[self.view addSubview:searchBar];
Run Code Online (Sandbox Code Playgroud)
我已经为取消按钮实现了这个方法:
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
[searchBar resignFirstResponder];
}
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
我在Xcode 5中打开了错误的项目版本,现在Xcode 4.6在尝试打开该项目时崩溃了.我只在Xcode 5中更改了一个xib文件,并使用Xcode 5在IB中打开了xib,在Interface Builder Document下,更改了从Xcode 5.0打开到Xcode 4.6.有什么想法为什么4.6在打开项目时崩溃?
编辑:
我制作了项目文件夹的副本,现在,即使所有文件都在旧项目文件夹中,当我打开项目时,它们都没有显示在xcode 4.6或5中.我的图像,类文件或任何东西都没有显示在xcode中,即使它们都在项目文件夹中.
我有一个搜索栏,我想尝试自动大写,如下所示:
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
{
searchBar.showsCancelButton = YES;
searchBar.autocapitalizationType = UITextAutocapitalizationTypeWords;
}
Run Code Online (Sandbox Code Playgroud)
默认情况下,当键盘出现时,Shift键会突出显示,但不会自动将任何单词大写.我究竟做错了什么?
在我的手表扩展中,我称之为此功能:
func requestAuthorization() {
let healthStore = HKHealthStore()
let workoutType = HKObjectType.workoutType()
let heartRateType = HKObjectType.quantityType(forIdentifier: .heartRate)
//reading
let readingTypes = Set([heartRateType!, workoutType])
//writing
let writingTypes = Set([heartRateType!, workoutType])
//auth request
healthStore.requestAuthorization(toShare: writingTypes, read: readingTypes) { (success, error) -> Void in
if error != nil {
print("error \(error?.localizedDescription)")
} else if success {
self.startButton.setEnabled(true)
} else if !success {
self.startButton.setEnabled(false)
}
}
}
Run Code Online (Sandbox Code Playgroud)
在AppDelegate.swift中,我有:
func applicationShouldRequestHealthAuthorization(_ application: UIApplication) {
let healthStore = HKHealthStore()
healthStore.handleAuthorizationForExtension { (success, error) -> Void in …Run Code Online (Sandbox Code Playgroud) 我正在尝试制作一个带有透明背景和彩色边框的圆形按钮.我怎样才能做到这一点?
我附上了我的一个iOS应用程序的屏幕截图,显示了我想要的内容.

我想添加一个带分页的UIScrollView来浏览我现有视图控制器的不同视图,这是我的应用程序的根视图.我还有标签栏和导航栏控制器.我是否可以向此视图控制器添加滚动视图以完成我想要的内容,如果是这样,有人可以指出我正确的方向如何去做吗?
这是我的视图控制器.
#import "KFBViewController.h"
#import "ListViewController.h"
#import "ActionAlertsViewController.h"
#import "MarketUpdatesViewController.h"
#import "AgStoriesViewController.h"
#import "KFBNewsViewController.h"
#import "MemberBenefits.h"
#import "SocialNetworks.h"
#import "WebViewController.h"
#import "YouTubeView.h"
#import "KFBFlickrViewController.h"
#import "RSFM.h"
#import "UAPush.h"
#import "TUSafariActivity.h"
@interface KFBViewController ()
{
}
@end
@implementation KFBViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self)
{
self.title = NSLocalizedString(@"Home", @"Home");
self.tabBarItem.image = [UIImage imageNamed:@"home"];
self.navigationController.delegate = self;
}
return self;
}
- (void) showMenu
{
NSURL *urlToShare = [NSURL URLWithString:@"https://itunes.apple.com/us/app/kentucky-farm-bureau/id580530986?mt=8"];
NSArray *activityItems = @[urlToShare]; …Run Code Online (Sandbox Code Playgroud) 我正在寻找一种在阅读器模式下在 Web 视图中打开 URL 的方法。这可以在简单的网络视图中完成吗?我已经查看并发现了关于此的其他问题,但他们没有答案。
ios ×7
android ×2
objective-c ×2
uisearchbar ×2
healthkit ×1
ios7 ×1
java ×1
swift ×1
uibutton ×1
uiscrollview ×1
uitabbar ×1
uitableview ×1
watchkit ×1
xcode ×1
xcode5 ×1
xcode6 ×1