Forum Xamarin.iOS

btn.Frame.X and btn.Frame.Location.X is not working to get the X and Y of a btn

I need to get the Y of a button so i can present a popup using its Y but the button is inside a tableView so when i move the table view the location is not actualized... how can i do that?

Posts

  • JohnMillerJohnMiller USForum Administrator, Xamarin Team Xamurai
    edited October 2013

    Hey @Sheepssj

    Try btn.Bounds.X, btn.Bounds.Y

  • SheepssjSheepssj BRMember

    Didnt worked budy... i need to get this done very quick any ideias?

  • adamkempadamkemp USInsider, Developer Group Leader mod

    You shouldn't need to get its frame for a popover. Use this:

    popover.PresentFromRect(button.Bounds, button, UIPopoverArrowDirection.Any, true);
    
  • JohnMillerJohnMiller USForum Administrator, Xamarin Team Xamurai

    Adam makes a good point.

  • SheepssjSheepssj BRMember

    It didnt work too... and i need to set the value of that rectangle so i can put the popup exactly where i want ... i dont know whats wrong, if i roll the tableView and then click on the button to start de popover it just go to the same place it was if i didnt rolled the tableView

    : any other tips?

  • SheepssjSheepssj BRMember

    help

  • adamkempadamkemp USInsider, Developer Group Leader mod

    FYI, this is a community forum so you can't expect immediate responses. We're not tech support. We don't get paid for this. :)

    Show us your code. I suspect you're doing something else subtly wrong. The code I posted should do the right thing no matter where the button is on the screen. Perhaps you're not using the right button?

Sign In or Register to comment.