Search code examples
iphonefacebookaddsubview

How is the location of a subView set?


I am using the standard facebook connect button with the method

FBLoginButton *loginButton = [[[FBLoginButton alloc] init] autorelease];
[self.view addSubview: loginButton];

and It places it where I dont want it. How can I set that subviews location?


Solution

  • Access the view's frame property:

    loginButton.frame = CGRectMake(originX, originY, sizeWidth, sizeHeight);