UITextField无法提供指标

时间:2014-09-05 00:56:50

标签: ios uitextfield

当用户点击文本字段时,通常闪烁指示符显示他们正在该iOS UITextField中键入。但是,在这个视图控制器上它并没有。但奇怪的是,当我在不同的视图控制器上使用相同的代码时,它确实出现了。

@interface MainViewController ()
{
        UITextField *fldye;
}

  fldye = [[UITextField alloc] initWithFrame:CGRectMake(165, 180, 140, 25)];
    fldye.placeholder = @"Year";
    fldye.keyboardType = UIKeyboardTypeNumberPad;
    [fldye setBackgroundColor:[UIColor whiteColor]];
    [fldye.layer setCornerRadius:5.0f];
    [fldye.layer setMasksToBounds:YES];
    [fldye setTextColor:[UIColor blackColor]];
    fldye.TextAlignment=NSTextAlignmentCenter;
    NSUserDefaults *defaujetzb = [NSUserDefaults standardUserDefaults];
    NSString *labsterzb = [defaujetzb objectForKey:@"mypreviousaddedyear"];
    fldye.text = labsterzb;

这些是我要添加的库......

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "Cellmain.h"
#import "Celleventmain.h" //I have two tableviews present on this controller as opposed to others
#import <MessageUI/MessageUI.h>
#import <iAd/iAd.h>
#import <StoreKit/StoreKit.h>
#import <FacebookSDK/FacebookSDK.h>
#import <AVFoundation/AVFoundation.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>
#import "AppDelegate.h"
#import <Social/Social.h>

#import <Accounts/Accounts.h>
@interface MainViewController : UIViewController <MFMailComposeViewControllerDelegate, NSXMLParserDelegate, UIImagePickerControllerDelegate, UITableViewDelegate, UITableViewDataSource, ADBannerViewDelegate, UIActionSheetDelegate, SKStoreProductViewControllerDelegate, CLLocationManagerDelegate, UITextFieldDelegate>

1 个答案:

答案 0 :(得分:1)

事实证明,色调颜色与其他奇怪的东西相冲突。我能够手动绕过它。

[fldye setTintColor:[UIColor blackColor]];