简体   繁体   中英

If I have different UI controls to display sequentially, should I still use a table view controller?

I want to implement something similar to this- (focus on the left portion)

例

I imagine possible implementations to be

  • Making a table view with (in this case) 7 'normal' cells, one normal size cell with a custom right accessory item, one 3XL cell containing a button, and finally a normal size cell with an imageview and custom accessory item.

or

  • Making a scroll view with styled view containing UILabels masquerading as 'cells', a button within a larger UIView, and another faux view-with-label-cell.

Considering the challenges posed by different screen sizes, and the want for easy configuration and modification- which way should mixed sequential data be displayed? Hacky table view, redundant scroll view, or reinvented custom UIView?

Edits

I am currently using a sliding view controller. The sliding functionality is of no worry to me, the contents of the scroll/table view within is.

There are various open source libraries available on net/github. you can use this https://github.com/edgecase/ECSlidingViewController .

Although you can make your own if you want but doing this using scrollview I don't think it will be a good way to do that.

Edit

You basically have to create 8 normal cells and change the color of the cell label which is selected. And create a footer view of YUTableview for last view.

You can use Slide-Out Navigation Panel. Use this slide-out-navigation for better understanding.

I've found more information on this, and I definitely overcomplicated a simple matter.

The answer is yes (use the table view), and there are multiple reasons- the first being the principle of always using the highest level of abstraction where practical.

Static UITableViewCells are completely capable of rendering other UI elements (buttons, sliders, etc) inside themselves from stock, and this is encouraged in Apple's UITableView spec . Dynamic cells, stock, are not as flexible but they can be subclassed from UITableViewCell for more custom functionality.

To speak for the example, the first X (in this case, 7) cells are likely dynamic, and the last 3 cells are static. The 'second to last' cell seems to have an infinite(?) height, and the last cell appears to be a sticky tableview footer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM