iOS ---textfield 评论效果

    UIView *commentView = [[UIView alloc]initWithFrame:CGRectMake(0, Kheight-35, Kwidth, 35)];

    commentView.backgroundColor =[UIColor yellowColor];

    [self.view addSubview:commentView];

    

    UITextField *commentText = [[UITextField alloc]initWithFrame:CGRectMake(10, 2.5, 194, 30)];

    commentText.font = JhFontsize(12);

    commentText.textColor =BaseBlackTextColor;

    commentText.backgroundColor = BaselineColor;

    commentText.placeholder = @"写评论...";

    commentText.layer.cornerRadius = 15.0;

    [commentView addSubview:commentText];


    //文本框左视图

    UIView *leftView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 37, 30)];

    leftView.backgroundColor = [UIColor clearColor];

    //添加图片

    UIImageView *headView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 5, 20, 20)];

    headView.image = [UIImage imageNamed:@"ic_xiepinglun"];

    [leftView addSubview:headView];


    commentText.leftView = leftView;

    commentText.leftViewMode = UITextFieldViewModeAlways;



猜你喜欢

转载自blog.csdn.net/iotjin/article/details/80338106