我的问题对你来说可能很容易.
我想UIImage在我的照片编辑应用程序中添加白色边框.我发现了一些问题和答案我如何拍摄UIImage并给它一个黑色边框?.
大多数答案都是为了添加边框UIImageView.在我的情况下,我需要添加一个UIImage可调节边框宽度的边框.
请问你能帮帮我吗?
我是非常初级的移动程序员.我需要在键盘出现时向上移动文本视图.我跟随此移动 - uiview-up-the-the-keyboard-in-ios它运行良好,但我有一个背景图像和我不想向上移动背景图像.所有文本框都嵌入在名为customView的UIView中.我试图向上移动customView而不是self.view.当我开始在第一个textview中输入时,customView向上移动.但是当我移动到第二个textview,customview移动到原始位置,textView成为keyboard.customView需要保持向上移动,当我开始进入第二个textview.我真的很感激任何帮助!
@property (strong, nonatomic) IBOutlet UIView *customView;
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
return YES; }
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
[self.view endEditing:YES];
return YES; }
- (void)keyboardDidShow:(NSNotification *)notification
{
//Assign new frame to your view
[self.customView setFrame:CGRectMake(0,50,320,460)];
}
-(void)keyboardDidHide:(NSNotification *)notification
{
[self.customView setFrame:CGRectMake(0,193,320,460)];
}
Run Code Online (Sandbox Code Playgroud)