Underline / Bold in UITextView
Use should use NSAttributedString, and use controllers for drawing NSAttributesString.
Controller for NSAttributedString
Note: you can't use UITextView to display a NSAttributedString
Update
From iOS6, UILabel now support NSAttributedString, you should use UILabel directly instead of OHAttributedLabel as it is now natively supported by the OS.
How can I achieve this text stroke effect with CSS?
A pretty cool challenge.
My solution is text-shadow based. So you need to change it and adjust it to your liking. i.e. How much you want your letters to cut out of the line.
So depending on your font type and size you will need to change text-shadow size. Also you can also stack more shadows on top of another if you want to make line cut bigger.
https://jsfiddle.net/1to5e8gL/
<h2>
An unmatched fishing & boating <br>
<span class="thick">experqiyencje</span>
</h2>
h2 {
background: #00008B;
color: #FFF;
font-family: sans-serif;
padding: 1em;
}
.thick {
font-size: 60px;
text-shadow: 8px 2px #00008B , -8px -2px #00008B;
}
span:after {
content: '';
width: 100%;
border-bottom: 3px solid #FFA500;
display: block;
margin-top: -7px;
}
Outline effect to text
There is an experimental webkit property called text-stroke
in CSS3, I've been trying to get this to work for some time but have been unsuccessful so far.
What I have done instead is used the already supported text-shadow
property (supported in Chrome, Firefox, Opera, and IE 9 I believe).
Use four shadows to simulate a stroked text:
.strokeme {
color: white;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
<div class="strokeme">
This text should have a stroke in some browsers
</div>
Margin top in inline element
This is not Firefox-only, and defined in the CSS 2.1 Specification:
8.3 Margin properties: 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', and 'margin'
Margin properties specify the width of the margin area of a box. The 'margin' shorthand property sets the margin for all four sides while the other margin properties only set their respective side. These properties apply to all elements, but vertical margins will not have any effect on non-replaced inline elements.
(Emphasis at the end is mine; margin-top
is a vertical margin)
Related Topics
React: "This" Is Undefined Inside a Component Function
How to Check If a Variable Is an Array in JavaScript
Is the JavaScript Date Object Always One Day Off
Getting JavaScript Object Key List
How to Make Console.Log Show the Current State of an Object
Jquery Scroll() Detect When User Stops Scrolling
How to Update the Parent'S State in React
Response to Preflight Request Doesn't Pass Access Control Check
Arrow Function Without Curly Braces
Why Does Babel Rewrite Imported Function Call to (0, Fn)(...)
Why Is It Necessary to Set the Prototype Constructor
Calling a Parent Window Function from an Iframe
How to Parse a CSV String With JavaScript, Which Contains Comma in Data
How to Match a Whole Word in JavaScript
How to Remove Item from Array by Value
For Loop For Htmlcollection Elements