0

I'm working on iOS RSS app, and my last view, which is a UIViewController, is similar to the attached image. I inserted in my DetailView.xib, one Image View to pass the images of the RSS feeds and two Text View to pass the title and summary respectively.

The question is, how can i make the same, but inside a UITableview?

Detail of Feed

3 Answers 3

1

you can use custom cells for it and can add this custom cell at particular index. At first index you just add image view and at second index you just add textview.

Check out this pretty good tutorial Custom UITableViewCell Using Interface Builder.

i hope it helps you.

4
  • thanks for your answer! Do you know if it is difficult to scale the Image View, according to the size of the photo that has been passed?
    – Edward
    Commented May 31, 2013 at 5:38
  • You can use autolayout for scale an imageView. Width would 320 but not more then and scale height whatever you want . Cell automatically scale according to image view size
    – chandan
    Commented May 31, 2013 at 5:43
  • i can use only one Table View Cell to create the whole UI, or i really need to create index for each element?
    – Edward
    Commented Jun 1, 2013 at 5:31
  • 1
    Hi Edward, it depend on situation that is required. You can customize your cell in every way. So don't need to create different-different cell for imageview and textview respectively. Otherwise it would become complex for you.
    – chandan
    Commented Jun 1, 2013 at 5:42
1

You can achieve this particular thing by using Custom Table View Cell. Table View gets created using single Table View Cell again and again. It is much more efficient and uses less memory.

You should check this tutorial.

I hope it will help you.

Thanks

3
  • thanks a lot for your answer! Do you know if it is difficult to scale the Image View, according to the size of the photo that has been passed?
    – Edward
    Commented May 31, 2013 at 5:47
  • 1
    Not actually, you can use the property of view to set image in image view, like aspectTofit or aspectTofill. You can deal with your images using these properties and make them fit in your imageview. Commented May 31, 2013 at 5:57
  • Your welcome! Let me know if you need any further help. Have a nice day ahead! Commented May 31, 2013 at 6:04
1

You can make TableView height UITableView.automaticDimension and make sure UITextView autoscroll is disabled and constraint should be leading, trailing, bottom and top.

Here's the link this might work for you: How to make a UITextView Expand with the text like the Notes app

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.