i got to much problem
MyImgView:
I need multiple images on a single view
I have:
UIImage -> UIImageView -> UIScrollView and UIScrollView is under UIView in Interface builder.
When i can add button(button is added on scrollview) and transparent to it, its not working and also it can lost its arrangement
UIButton *Imgbtn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[Imgbtn1 setAlpha:0.019];
[Imgbtn1 setFrame:CGRectMake(curXLoc, curYLoc, 160.0, 210.0)];
if(curYLoc == 0.0)
{
curYLoc=210.0;
}
else if(curYLoc == 210.0)
{
curXLoc+=160.0;
curYLoc = 0.0;
}
NSString *imageName = [NSString stringWithFormat:@"img%d.jpg", i];
UIImage *image = [UIImage imageNamed:imageName];
UIImageView *MyImageView = [[UIImageView alloc] initWithImage:image];
CGRect rect = MyImageView.frame;
rect.size.height = kScrollObjHeight;
rect.size.width = kScrollObjWidth;
MyImageView.frame = rect;
MyImageView.tag = i; // tag our images for later use when we place them in serial fashion
MyImageView.userInteractionEnabled = YES;
[scrollView addSubview:MyImageView];
[scrollView addSubview:Imgbtn1];
and other solution when
after enable userInteraction on UIImageView its also not working on. the touchedbegin function not called.
NSString *imageName = [NSString stringWithFormat:@"img%d.jpg", i];
UIImage *image = [UIImage imageNamed:imageName];
UIImageView *MyImageView = [[UIImageView alloc] initWithImage:image];
CGRect rect = MyImageView.frame;
rect.size.height = kScrollObjHeight;
rect.size.width = kScrollObjWidth;
MyImageView.frame = rect;
MyImageView.tag = i; // tag our images for later use when we place them in serial fashion
MyImageView.userInteractionEnabled = YES;
[scrollView addSubview:MyImageView];
ShopViewController:
This is a tableview (UITableViewController subclass)
In this class i have a custom button of CALL and LOCATE how can i generate event on that button; button is in tableview cell
and how can i locate (On Iphone samples 'locate me' procduced correct location?)
and how can i make calls with call button?
and in both of the classes how can i know which UIButton and which UIImageView is triggered?
UIView *Vi = [[UIView alloc] init];
btnCall = [UIButton buttonWithType:UIButtonTypeCustom];
[btnCall setImage:[UIImage imageNamed:@"Button.png"] forState:UIControlStateNormal];
[btnCall setFrame:CGRectMake(0.0, 80.0, 100.0, 40.0)];
[btnCall addTarget:self action:@selector(action

forControlEvents:UIControlEventTouchUpInside];
[Vi addSubview:btnCall];
in the last
[cell.contentView addSubview:Vi];
action function just print hello on log
----------------------------------------------------------------------------------------------------------------
Regards,
Muhammad Owais Nadiadwala
Software Engineer,
Salsoft Technologies.
Official Email:
Owais@salsoft.net
Messenger:
mohammadowais@msn.com
Cell: +92-0333-2366692