0

I'm wondering if there is a way to set an ImageView in a TableViewCell to full screen width even behind the accessory? I would like to keep the indicator to be consistent with the other cells I have. If not is there any workaround?

Thank you!

enter image description here

N. Beer
  • 109
  • 1
  • 10
  • Using a "stock" table cell, probably not. But you have a few custom ways of doing this. My question is more to why you want to do this. Most users expect nothing behind a disclosure indicator, at least a "stock" one. For small cells (think a table view with 6 visible cells on a 4.7 inch screen) it may be difficult to not have the indicator blend in with a background image. –  Jan 03 '20 at 19:29
  • Thanks for the answer. Let me try to explain it again. I would like to have kind of a background image instead of the white table cell bg. If you click on it it will still lead you to the details therefore I'd like to have the indicator on top of it. But on the pic above the accessory view will be white with the indicator in it instead of a full screen image behind the indicator. – N. Beer Jan 07 '20 at 21:26
  • It's been a while - and unfortunately I can't find any code - but it sounds like you want a *"custom accessory button"*. Doing a quick DuckDuckGo search, I found something that hopefully will send you in the right direction: https://stackoverflow.com/questions/49949150/custom-accessory-button-in-uitableviewcell –  Jan 08 '20 at 11:34
  • Thanks for your help! I now resolved it with having the background full width without an accessory view and inserted a custom disclosure indicator. – N. Beer Jan 10 '20 at 23:39
  • Please post an answer - it may help others! (I'd gladly upvote it.) There's nothing wrong with answering your own question. –  Jan 11 '20 at 01:54
  • Good point. I've posted an answer. Thanks for your comments! – N. Beer Jan 19 '20 at 22:03

1 Answers1

1

I solved it now with a custom disclosure indicator. So with hiding the entire accessory view and placing the icon on top of the full width UIImageView like in the image below.

enter image description here

N. Beer
  • 109
  • 1
  • 10