tags:

views:

29

answers:

1

I haved tried to create a view with a UIButton and a tableView Cell, then I set the header view to be this view. However,the cell in the header is not rounded-rect, besides,how to handle the cell's event,when user click this cell.

I haved tried to use custom cell also, but how to create a button and a shorter cell in a row? when you select the cell,will not affect the button state?

thanks.

+1  A: 

You can fake this in a number of ways. The simplest is to layout a rounded rectangle UIButton in your header, and turn off userInteraction for it so that it's just decorative.

Ben Gottlieb
Do you mean that I layout two UIButtons in tableView's header?and fake one of it as a cell?
xia
yep, that's the trick.
Ben Gottlieb
thanks,but it seems a little difficult.I want the cell to have a accessory disclosure button. when touch the cell,it is only highlighted,only when touch the disclosure button can trigger the action.
xia
With this method, you probably can't use a built-in accessory view; you'll have to add your own, manually.
Ben Gottlieb
Add my own? Do you mean adding my accessory view to the button?But how to determine whether the user touch the accessory view or not?
xia
ok,I got it.I use two buttons,one button(Round Rect) as the cell,then add another button to it and set its type as detail disclosure.thanks a lot for enlighten me
xia