谁知道诀窍?
我不能张贴图片,因为我是新来的stackoverflow.这是一个效果,它们似乎是一个圆形椭圆形,但内部有2个文本字段.一个用于用户名,一个用于密码.
解决方法 你可以使用下面的代码.// in .h文件
UITextFIEld *loginID; UITextFIEld *password ;
// in .m文件
- (NSInteger)tableVIEw:(UItableVIEw *)tableVIEw numberOfRowsInSection:(NSInteger)section{ return 2; } - (UItableVIEwCell *)tableVIEw:(UItableVIEw *)table cellForRowAtIndexPath:(NSIndexPath *)indexPath { UItableVIEwCell *cell = [table dequeueReusableCellWithIDentifIEr:@"Cell"]; if( cell == nil) cell = [[[UItableVIEwCell alloc] initWithStyle:UItableVIEwCellStyleDefault reuseIDentifIEr:@"Cell"] autorelease]; if (indexPath.row == 0) { loginID = [[UITextFIEld alloc] initWithFrame:CGRectMake(5,280,21)]; loginID .placeholder = @"loginID"; loginID .autocorrectionType = UITextautocorrectionTypeNo; [loginID setClearbuttonMode:UITextFIEldviewmodeWhileEditing]; cell.accessoryVIEw = loginID ; } if (indexPath.row == 1) { password = [[UITextFIEld alloc] initWithFrame:CGRectMake(5,21)]; password.placeholder = @"Password"; password.secureTextEntry = YES; password.autocorrectionType = UITextautocorrectionTypeNo; [password setClearbuttonMode:UITextFIEldviewmodeWhileEditing]; cell.accessoryVIEw = password; } loginID.delegate = self; password.delegate = self; [tableVIEw1 addSubvIEw:loginID]; [tableVIEw1 addSubvIEw:password]; [loginID release]; [password release]; cell.selectionStyle = UItableVIEwCellSelectionStyleNone; return cell; } - (NSInteger)numberOfSectionsIntableVIEw:(UItableVIEw *)tableVIEw{ return 1; }总结
以上是内存溢出为你收集整理的iphone – iOS:桌面式TextField登录屏幕?全部内容,希望文章能够帮你解决iphone – iOS:桌面式TextField登录屏幕?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)