How to display both text and images on the same view? Thanks
I know there is an app on iPad called "Flipboard".
There is a view on Flipboard. It contains both text and images. The text is divided into columns. And the text is around the image. I have attach a picture on this thread. I don't know how to implement that effect.
1. Use CoreText frame. This frame can help me make the text block to create columns. But I can insert image into the text block.
2. Use a UIWebView. I can create a html web file which contains columns text and images. And then load it into my UIWebView. At last, I draw it and paste the drawn context to where I want it to be. But the issue is, I can't control the size the text block. Because I control the size with CSS. It seems that I can't re-write the CSS file or html file to fit my iPad's screen. I can't control the image's position where it is shown either.
So is there anybody can give me a way to implement it? If there is, I will appreciate very very much!
i think that the more reliable solution is uiwebview, you should be able to change css and what you want to fit your requirements, you can control all, i don't understand what's the problem with that....
Position all programmatically can be painful.....but can be done if you know for example that you will have 3 columns + 2 images, because you can retrieve how many space your text take (on a textview should be textView.contentSize; )
However attachments image doesn't work on this forum
i think that the more reliable solution is uiwebview, you should be able to change css and what you want to fit your requirements, you can control all, i don't understand what's the problem with that....
Position all programmatically can be painful.....but can be done if you know for example that you will have 3 columns + 2 images, because you can retrieve how many space your text take (on a textview should be textView.contentSize; )
However attachments image doesn't work on this forum
Thank you very much for your replay. Maybe it's very late on your time zone. If it's very late, you'd better go to sleep.
What I mean "can't control" is that I can't control the property in CSS through my Cocoa project. For example, I could have a html file with its CSS file. All the properties is fixed on the CSS file. The columns count is 3, and size of the text block is 700*900. Now I load the two files into my UIWebView. I read them and want to change the columns count from 3 to 2, and the size from 700*900 to 910*710. I don't know how to do that. How could I change those properties through re-write the two files?
yes, you can programmatically change css and html, just open as simple file text, parse what you want, change and save, and reload the uiwebview
the best way maybe is to create a method to create programmatically the css and html (instead of parse a manual written css\html)
Thank you. But could you tell me which function or class should I use for re-writing html or css files? I only know how to parse a XML file using XMLParser ...