iOS

Day10:UITextView和UIMotion

2015-05-20  本文已影响229人  Vinc

UITextView:文本视图控件,父类是UIScrollView,用于输入或者显示一行或多行内容,当输入或展示的内容超过textView.fame.size.width时自动换行,当内容超过textView.fame.size.height时自动出现滚动条
UITextField:用来输入一行内容

一.UITextView

  1. 常用设置
  2. 隐藏键盘方法
  3. 模仿微信输入界面

二.UIMotion

手机摇动时执行的方法("UIResponder"中的motionBegan:withEvent方法)

一.UITextView

  1. 常用设置
     UITextView *textView = [[UITextView alloc]initWithFrame:CGRectMake(20, 74, 200, 100)];
     [self.view addSubview:textView];
     //    背景色
     textView.backgroundColor = [UIColor yellowColor];
     //    本文颜色
     textView.textColor = [UIColor greenColor];
     //    字体
     textView.font=[UIFont systemFontOfSize:24];
     //    设置是否允许编辑,默认是YES
     textView.editable = YES;
     //    设置是否允许滚动,默认是YES
     textView.scrollEnabled = YES;
     textView.delegate = self;
     textView.text = @"this is textView";
    

UIMotion


上一篇 下一篇

猜你喜欢

热点阅读