I have this RTF in my UITextView object:
"Test text <img src='http://icons.kdaweb.com/commerce/png/50x30/payment_types-american_express.png'> test text.
And result is here
I need to move image for few pixels under baseline, but <img style=...> doesn't work.
What can i do with image without using UIWebView ?
SOLUTION:
One style attribute works for me:
img {vertical-align:-5px;}
I really suggest you to use the UIWebView. Writing the img tag don't let you many choices. Using this class will help to well structure your code, avoiding any non maintainable code.
Then you'll be able to play with a CSS sheet, I really prefere the UIWebView solution.
Edit
A way I don't recommend but could be a (bad) solution: make bigger the text and change img height to the text height. But you'll need to have a better image (SVG ?).
Related
Can I put a UIButton or UITextField or UITextView between the texts in Swift
examples:
"What is your **[UITextField]** about downloading free music files from the Internet?**[UIButton]**"
"What is your
**[UITextField]** about
downloading free
music files from the
Internet?**[UIButton]**"
Like "example2", the layout may change depending on the situation.
Not a particularly easy task. You can use attributed text to stylize a word and make it "tappable" (like a hyperlink on a webpage), but that wouldn't solve the issue of embedding an editable text field in the string.
One approach would be to embed "placeholder" text in your string, then find the bounding box for that word and overlay a textfield or button. You'd have to be sure to account for things like word wrap, and it would take some experimentation to get the widths right.
So, you might set the text of your label to:
What is your UITextFieldGoesHere about downloading free music files from the Internet? UIButtonHere
Then use code to find the bounding box / rect of UITextFieldGoesHere and position a text field on top of that, so it covers the word and looks like it is inline. Same thing with the UIButtonHere.
If your button might be simply OK, and you don't want it wide with left-right padding, change that placeholder in your string to something like OKB ... just make sure it is unique so you can find it.
Lots of examples out there for finding the bounding box / rect of a word in a label... use Google (or your favorite search engine) to search for:
uilabel find bounding box of specific word
Whenever I add a picture to google spreadsheets in editor mode It always appears lower when viewed in Html Mode. Is their a fix for this?
You can instruct Google Spreadsheet engine with ease how you want the images to render by using this syntax:
To retain aspect ratio while increasing / decreasing the cell size:
=IMAGE("URL")
To make the image stretch and fit all edges of the cell:
=IMAGE("URL",2)
To make the image keep its original size:
=IMAGE("URL",3)
To manually set the image size (replace 50,50 with desired dimensions):
=IMAGE("URL",4,50,50)
Now to answer your question more directly. There are several reasons why this can happen. This comes to how Google are actually translating the spreadsheet and rendering it as HTML.
With that said, it is hard to answer your question with the correct answer while not being able to look at the spreadsheet and the output of the html.
Update
Looking at your source:
The problem is that the CSS that is outputted generates topÄ and left values that makes the image be off by the y axiz.
Here is a method to edit the CSS in Google Spreadsheet if you are familiar with it: http://lifehacker.com/387849/style-your-google-docs-with-css
If you are not familiar with it its probably not much help, but anyway!
If you find this answer helpful please tick accept and up it, i need it :-)
I trying to create a fixed border to the site that dynamically change size with the browser window from this sprite (it isn't perfect I know.): http://fc07.deviantart.net/fs70/f/2011/269/7/0/bordersprite_by_nakos-d4ayzne.png
DEMO on jSFiddle
My problem as you can see is the vertical wall part. As the #falJ and #falB are height:100% they include the bottom wall's end too with the space between the two wall sprites. Is there a way to force backround-position to only use vertical wall part without bottom wall's end?
Thanks in advance.
Solution: http://jsfiddle.net/vonkly/Ld43B/
It's not the prettiest thing in the world, but it achieves what you want. Check out the source code & direct link for the background images to see what you'll need to do. It's currently set at 299px wide; I imagine you'll be using something wider.
I'd also suggest adding some padding around your content (either with a p tag, span, another div, etc.) - the way it is currently set up isn't what I'd recommend for readability.
EDIT
The only way I can imagine achieving a fluid width + height box with the borders that you have in the way that you want is to use a second image for the west and east containing divs. This should work with your current method.
I am facing a problem placing a large text into multiple UITextView/UILabel.
Example: Please see the attached picture ,it explains my problem.
assume three boxes are UITextViews or UILabels. Text will get from server as a complete one NSString, Now challenge is to place the text in the boxes (UITextView/UILabel).
could anyone please help me in solving this problem.
A UIWebView might be more suitable for the task of laying out a page. You could then use html with CSS floats to achieve the effect you're looking for.
If you do not want to use UIWebView, I suggest looking at Core Text for layout.
If you have bounding box for those elements, than you can easily implement this logic by iterating usage of method - (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(UILineBreakMode)lineBreakMode and removing by one word from string till returned size will fit into bounding box for corresponding section, than truncate text to place where you stop removing words and complete with other sections.
I am new to jQuery I am facing a some problem with jQuery gradient image please give me some solution for this
I have one div divided vertically in three part left, middle,right.The div has a background images (that is gradient) .and there is some data in the div. I want that the image height should be increase when the user input more data in the div
Can we increase the height of the gradient image using jQuery. Please give me some reference site or some solution
I don't know that you need JQuery to do this for you; it will be fun to do it on you own.
As you know, you can style the div such that its height will increase as you add more content to it. So your question really is how to make the gradient background appear the way you want it: you might want the gradient to grow lighter and lighter at the bottom, say, as the div increases in height. It just so happens (lucky you!) that background-image CSS is rich and capable. That's why it's fun: it actually works!
Read about CSS background-position for some ideas. You might find that the effect you want is automatic.
-- pete