简体   繁体   中英

Creating a timeline using Xamarin.ios

Using Xamarin.ios,

given that you have a bunch of items where each item has a Content (string) and some metadata. (think Facebook log entry).

What would be the approach to implement a tableview that displays this data?

The problems I'm having is

A) Auto adjust the height of the UILabel or TextView to fit the dynamic text in Content B) Docking metadata (a UILabel) at the bottom of the UITableViewCell C) Calculating the entire row height in the TableDataSource

I don't need code examples, just some insight in what to study.

I'm using Storyboarding in XCode to build the UI.

Thanks

A) Auto adjust the height of the UILabel or TextView to fit the dynamic text in Content

You can use methods SizeToFit() and SizeThatFits(SizeF size) .

B) Docking metadata (a UILabel) at the bottom of the UITableViewCell

Check out Auto Layout and Constraints . You can define, that the Y coordinate of a label should be something like container.Bottom - label.Heigth - 20 .

C) Calculating the entire row height in the TableDataSource

You should do this in GetHeigthForRow . Just add up all the controls heights and spaces between the controls.

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