NSShadow: shadowOffset property
The shadowOffset property is how far the shadow is offset from the text.
Value
- Readable and writable.
- The default is
(0, 0). - A positive
widthis to the right, and a positiveheightis downward. Negative numbers are to the left and upward. - Accepts a
CGSizeor{ width, height }on write. TheCGSizeread back is read-only; to change it, assign a new value.
Invalid values
TypeError
Not an object, or a field is missing or not a finite number; for example, shadowOffset is missing height, or it is not a finite number.
Examples
js
const shadow = new NSShadow();
shadow.shadowOffset = { width: 1, height: 2 };
console.log(shadow.shadowOffset.width, shadow.shadowOffset.height);Result: The console prints 1 2.
Corresponding iOS API
NSShadow.shadowOffset.