当我们点击它时,UItextfield不可编辑

时间:2016-02-11 06:16:18

标签: ios objective-c uitableview uitextfield uitableviewsectionheader

您好我是ios的新手,在我的应用中我添加了UITableList,我在package com.ge.health.gam.poc.publisher; import javax.jms.JMSException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jms.core.JmsTemplate; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.ResponseBody; import com.ge.health.gam.poc.consumer.DemoConsumer; @Component public class DemoPublisher { @Autowired JmsTemplate jmsTemplate; public void demoPublishMessage(String message) throws JMSException{ jmsTemplate.convertAndSend("NewQueue", message); System.out.println("Message sent"); } } UIView添加了xib tableList个文件

此处我在HeaderView UItextfield个文件中添加了一个UIView,当我点击xib时,它不可编辑,我的意思是textfield请帮帮我一个

我的代码: -

click action not working

3 个答案:

答案 0 :(得分:1)

您可以通过以下任何方式执行此操作

header.coridersTextfield.editable = YES;
// or 

 header.coridersTextfield.userInteractionEnabled = YES;

// or 

  header.coridersTextfield. enabled = YES;

或使用委托方法

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
return YES;
}

<强>更新

UIView *HeaderView = [[UIView alloc] init];
HeaderView.frame = CGRectMake(x,y, width, height); // customize frame and set the Height based on your Subviews Height

答案 1 :(得分:0)

HeaderView的边界是(x:0,y:0,width:0,height:0)

执行以下操作:

UIView *HeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGrectGetWidth(tableView.bounds), 44.0f)];

答案 2 :(得分:-1)

选择textView并检查属性检查器。可能就是这种情况!

enter image description here