テーブル ビューには、名、姓、メール アドレス、電話番号があります。サーバーからデータを取得してデバイスに表示できる Web サービスがあります。問題があります。サーバーからフェッチしているデータは完全に表示されていますが、一部の電子メール アドレスは非常に長いため、電子メール アドレスの半分の後にドット ドットが表示されます (つまり、raboert.baderasam11@gma.. ..)。
電子メール アドレスをタップすると、すべてのテキストまたはラベルが強調表示され、完全な電子メール アドレスが表示されるようにする方法はありますか? または、電子メールアドレスを強調するツールチップはありますか?複数ではなく単一のビューで表示したい. このタスクは実行する必要があります。だから私を助けてください。iPhone開発初心者です。
here is the code :-
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath*)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
NSArray* currentListOfItems=nil;
Contact *aContact=nil;
if(searching){
currentListOfItems=searchResult;
aContact=[searchResult objectAtIndex:indexPath.row];
}else{
currentListOfItems=content;
aContact=[[[content objectAtIndex:indexPath.section] objectForKey:@"rowValues"]
objectAtIndex:indexPath.row];
}
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier];
UILabel *lbl3 = [[UILabel alloc]initWithFrame:CGRectMake(12, 0, 150, 20)];
[lbl3 setTextColor:[UIColor blackColor]];
[lbl3 setFont:[UIFont boldSystemFontOfSize:16.0]];
lbl3.text =[NSString stringWithFormat:@"%@ %@", aContact.lastName,aContact.firstName];
[cell addSubview:lbl3];
UILabel *lbl1 = [[UILabel alloc]initWithFrame:CGRectMake(12, 20, 200, 20)];
[lbl1 setTextColor:[UIColor blackColor]];
[lbl1 setFont:[UIFont boldSystemFontOfSize:12.0]];
lbl1.text = aContact.email;
[cell addSubview:lbl1];
UILabel *lbl2 = [[UILabel alloc]initWithFrame:CGRectMake(210, 20, 300, 20)];
[lbl2 setTextColor:[UIColor grayColor]];
[lbl2 setFont:[UIFont fontWithName:@"Arial" size:12.0]];
lbl2.text = [NSString stringWithFormat:@"%@%@", @"| ",aContact.phone] ;
[cell addSubview:lbl2];
return cell;
}