Need Help
  #1 (permalink)  
Unread 02-25-2009, 02:06 PM
os.salsoft os.salsoft is offline
Junior Member
 
Join Date: Feb 2009
Posts: 1
Default Need Help

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT. The time now is 11:04 PM.


vBulletin skin developed by: eXtremepixels
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28