0

I'm creating an iOS mobile application using Xamarin. I'm new in mobile development, especially on iOS. I have a table view rows, that have background images. So when I'm changing the iphone version from 5s to 6S, they are stretching. I need them to be auto resizable.

enter image description here

First one is my table view , the second one is the detail view of current row.

Can someone help me with this and at least tell a good topic to read. Thanks before hands.

enter image description here

Here's what I have now , and I just can't remove that left offset that each row has.

UnuS76
  • 149
  • 1
  • 13
  • My guess is you simply want to choose **Aspect Fit** or **Aspect Fill**, rather than your current setting. Just a general comment, I don't know anyone who's ever benefitted from Xamarin; just learn ordinary native development (it's literally much easier). – Fattie Jan 31 '17 at 14:40

1 Answers1

1

First, you have to set the constraints on your UIImaveView to set the size and the position of your view.

Then, you have to set your UIImageView's Content Mode to Scale To Fill in order to have the image resized automaticaly.

You can take a look at this post to understand all Content Mode available.

Community
  • 1
  • 1
Maxime Esprit
  • 365
  • 2
  • 20
  • 1
    It's likely Aspect Fit or Aspect Fill they want - not scale to fill. – Fattie Jan 31 '17 at 14:41
  • Hey Maxime, thanks for Your response. I can't add constraints to tableview row , because it's the default row of that table view. I can't find a way to do that. I now the way how it must be done on other items, but I can't find the way I must do it on that row. – UnuS76 Feb 01 '17 at 10:08
  • Do you use a UITableViewController ? If that is the case, it's normal. You should use a UIViewController, add a UITableView to this controler, and add a UITableCell to this tableview. – Maxime Esprit Feb 01 '17 at 10:56
  • Well I'm working on master-detail view application , which already has table view in it (with its controller.) I'm just populating it with my data. I've also created a cell class, which I'm using instead of default UIViewCell. – – UnuS76 Feb 01 '17 at 17:50
  • 1
    Ok, take a look at this verry nice video : https://www.youtube.com/watch?v=3w61d2hLnf0&t=1780s Alex Corrado shows how to configure a nice tableview with a TableviewControler, just like your master-detail view app. I think you need to play with your cell's constraints. Also take a look at this post to see how to constraints your cell http://stackoverflow.com/questions/41959943/lateral-cell-space-tableview-swift/41960072#41960072 – Maxime Esprit Feb 02 '17 at 08:46
  • Thanks for Your comments mate. The video was cool. I can't play with cell constraints, because I can't put them in the default table view cell. I can put constraints on every other things , but not the default table view cell. Maybe it should be done using code, because there's no way to add it using UI. The buttons of adding the constraints are disabled. – UnuS76 Feb 02 '17 at 11:04