I am using the corona sdk to create a list of items in a tableview, once and item is selected I then display a bio for that item, and also want to display an image.
I can do this fine, but how can I right align the image in the body of text and get the text like flow round the image? I am using native.newText to display the text.
Similar to having a right aligned image inside a tag in HTML.
You cannot do that automatically, you need to detect the image dimensions (I suggest using myImage.contentBounds ) then place the text near it as you wish.
In a app of mine we display a picture, some basic data, and a detailed description, what I do is put the picture, then place the basic data to its right, and then place the detailed description below both.
Related
I want to design like below:
I am using core text to draw a multicolumn, i can show it up, thats not problem, need to show image as static like image,
First three column need to show, the fourth column will show by scrolling horizontal.
1.Need to add hyper link to video url.
2.Need to design like above..
Sample tried with two ways:
https://github.com/karthisiva/CoreTextWithImage
The content will be html text.
I need to make text within a UITextView to be clickable. Basically I want to show more information on the text being clicked on. In PHP I would surround the text I want clickable in square brackets and then make anything in square brackets a link (i.e. [More Info]). How can I do something similar in Swift? I know I can turn on data detectors to detect http links but I don't want http showing.
Is there a way so that you can set both image and title of UISegmentControl simultaneously, so that image appear next to the title , just like image appear next to title in UIButton.
I am trying but if I set image of Selected segment of UISegmentControl then title disappears and if I set title of Selected segment of UISegmentControl then Image disappears, I want to set both at a time.
The official documentation for -setImage:forSegmentAtIndex: says
A segment can only have an image or a title; it can’t have both. There is no default image.
So, no, there is no way to do what you want using the image and title properties.
However, there are a few options to accomplish the objective in different ways.
if you are going to use the same image for each segment, you could use the appearance methods to set the background and then use the method -setContentOffset:forSegmentAtIndex: to move the title to the side of the background image.
you could create an image that had both the icon and the text in it. This is less than ideal as a change to the text requires exporting of the entire asset again. But is an option.
the least ideal would be to fake a segmented control using buttons that you write the code for to handle state changes. There may even be some open source options that do just that, so feel free to search for them.
I'm working on a project where I want to let the user pic a photo from the library (that part works). The photo is then displayed in a UIImageView behind some UILabels (containing text, color ...) (this already works, too). Now I want to create an image with both the photo in the background and the labels in the front - is this possible and if yes, how?
Here is a simple mockup : http://www.screencast.com/users/PascalFritzen/folders/Default/media/8d3d045d-d5c0-43f9-b6c2-1ec9a53daf32
save text in plist or DB or any array then When you want to show images with text then use this image with plist or Array to show lable(Sorry for english)
http://www.flickr.com/photos/fraserspeirs/4329430635/in/set-72157623224262135/
The above is a link basically showing the form fill view of the numbers app on the iPad. Any idea as to how to achieve such a functionality which sort of looks like our vanilla tabs on Chrome?
You could do it with just buttons set to Custom type and using an image for the background. Then when they are clicked, bring the specific UIView to the front.
To create the tabs from a single image use UIImage's stretchableImageWithLeftCapWidth: topCapHeight:
http://tcninja.blogspot.com/2010/09/ios-adding-stretchable-uiimage-as.html
This will let you dynamically set the image's width in a way that will use the middle of it to fill the new area rather than stretching (and warping) the outer edges.
I would have implemented this with simple UIButtons. All you need to do is to style them (pngs or whatever), and track which one is the current.