Log in or register to post comments

Button located on the EAGLView I will never be able to tap

August 21, 2012 - 10:19pm #1

Hi.

I have a test to put a UIButton on EAGLView.

However, I will not be able to tap the button located on the right side.

 

We are testing the correct value of the sample as follows: ImageTargets.

====================

@implementation EAGLView

 

- (id)initWithFrame:(CGRect)frame

{

    self = [super initWithFrame:frame];

    

if (self)

    {

        // create list of textures we want loading - ARViewController will do this for us

        int nTextures = sizeof(textureFilenames) / sizeof(textureFilenames[0]);

        for (int i = 0; i < nTextures; ++i)

            [textureList addObject: [NSString stringWithUTF8String:textureFilenames[i]]];

 

 

UIButton *btnBtn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[btnBtn1 setTitle:@"foo" forState:UIControlStateNormal];

[btnBtn1 setTitle:@"Touch!" forState:UIControlStateHighlighted];

btnBtn1.frame = CGRectMake(5, 5, 100, 40);

[self addSubview:btnBtn1];

 

    

btnBtn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[btnBtn1 setTitle:@"bar" forState:UIControlStateNormal];

[btnBtn1 setTitle:@"Touch!" forState:UIControlStateHighlighted];

btnBtn1.frame = CGRectMake(480 - 100 -5, 5, 100, 40);

[self addSubview:btnBtn1];

 

btnBtn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[btnBtn1 setTitle:@"foo2" forState:UIControlStateNormal];

[btnBtn1 setTitle:@"Touch!" forState:UIControlStateHighlighted];

btnBtn1.frame = CGRectMake(5, 320 - 40 - 5, 100, 40);

[self addSubview:btnBtn1];

 

btnBtn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[btnBtn1 setTitle:@"bar2" forState:UIControlStateNormal];

[btnBtn1 setTitle:@"Touch!" forState:UIControlStateHighlighted];

btnBtn1.frame = CGRectMake(480 - 100 -5, 320 - 40 - 5, 100, 40);

[self addSubview:btnBtn1];

 

btnBtn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[btnBtn1 setTitle:@"center" forState:UIControlStateNormal];

[btnBtn1 setTitle:@"Touch!" forState:UIControlStateHighlighted];

btnBtn1.frame = CGRectMake(0, 0, 100, 40);

btnBtn1.center = CGPointMake(480 / 2, 320 / 2);

[self addSubview:btnBtn1];

 

}

    return self;

}

====================

You can tap the button foo, foo2 button, center button, however, bar buttons, bar2 button can not be tapped.

 

My environment is as follows.

MacOS version:10.6.8

Xcode version:4.2 build 4C199

Device model:iPhone4S[iOS:5.0.1(9A406))]

 

Since we are using machine translation, sorry was hard to read.

Button located on the EAGLView I will never be able to tap

August 24, 2012 - 1:31pm #5

Nevermind. I found what you were referring to in the Vuforia SDK samples folder.

Button located on the EAGLView I will never be able to tap

August 24, 2012 - 1:05pm #4

This is the same issue I am working on. It would be very helpful if you could direct me to where I can find this in the code. By "existing code" do you mean the Xcode project or the QCAR scripts? Thanks.

Button located on the EAGLView I will never be able to tap

August 22, 2012 - 3:08am #3

Thank you for your reply.

I'm not being recommended to put a UIButton to EAGLView.

All right.

Try to keep the OverlayViewController UIButton.


Thank you all!

Button located on the EAGLView I will never be able to tap

August 22, 2012 - 2:53am #2

Hi nobu,

Please look at the existing code for ImageTargets and the way it adds an OverlayViewController which contains the gui, buttons etc.

This is probably a better option for adding buttons rather than putting them into the EAGLView.

HTH

Log in or register to post comments