for (NSString *arrayString in appDelegate.saveTCellImg )
{
k++;
CGRect frame = CGRectMake(curXLoc, curYLoc, 60, 50);
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = frame;
UIImage *theImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:[ NSURL URLWithString:arrayString]]];
NSLog(@" BUTTON INDEX IS = %d",k);
button.tag=k;//[arrayString intValue];
rowID=k;
[button setImage:theImage forState:UIControlStateNormal];
//[button setImage:[UIImage imageNamed:[appDelegate.saveTCellImg objectAtIndex:0]] forState:UIControlStateNormal];
[button setTitle:(NSString *)[appDelegate.a1 objectAtIndex:k] forState:(UIControlState)UIControlStateNormal];
[button addTarget:self action:@selector(buttonEvent: ) forControlEvents:UIControlEventTouchUpInside];
curXLoc +=60;// (kScrollObjWidth1);
if(curXLoc>=200)
{
curXLoc=20;
curYLoc+=150;
}
NSLog(@" WIDTH IS %d",curXLoc);
// NSLog(@" WIDTH IS %d",kScrollObjWidth1);
[self.view addSubview:button];
}
No comments:
Post a Comment