1.0.5 • Published 5 years ago

ti.attributed v1.0.5

Weekly downloads
2
License
ISC
Repository
-
Last release
5 years ago

ti.attributed

Attributed strings made easy for Appcelerator Titanium Alloy MVC framework. Most of the Attributed Strings available through this module are documented from https://wiki.appcelerator.org/display/guides2/Attributed+Strings

Quick Start

How to use

You can use this library from different way, from Controller, View / Style

Controller: ES6

import { underline } from 'ti.attributed';
underline($.label, 'wordInLabelToUnderline')

ES5

const tiAttributed = require('ti.attributed')
tiAttributed.underline($.label, 'wordInLabel')

View

<Label module='ti.attributed' attribute: 'underline' text='Hello this will be underlined' />

TSS

<Label class='myLabel' module='ti.attributed' />
".myLabel" : {
  attribute: 'underline',
  text: 'Hello this will be underlined'
}

Methods (Attributed Strings) available

  • color
  • backgroundColor
  • underline
  • underlineAndColor
  • bold
  • boldAndColor
  • strikethrough
  • link
  • kern
  • shadow
  • letterpress
  • baseline
  • obliqueness
  • stretch
MethodDescriptionUse
colorChange the text color
backgroundColorChange the text backgroundColor
underlineUnderline the text
underlineAndColorUnderline and change the text color
boldBold the text
boldAndColorBold and change the text color
strikethroughStrike the text
linkAdd link to the text
kernKern the text
shadowAdd shadow to the text
letterpressLetter Pres the text
baselineBaseline the text
obliquenessAdd obliqueness to the text
stretchStretch the text

Properties available

  • attribute
  • wordAttribute
  • wordValue
  • attributeColor
  • attributeFont
PropertyDescriptionUse
attributeMethod / Atributed string name*required
wordAttributeAttributed string applied to*required
wordValueAdditional Attributed value for select methods*optional
attributeColorColor for select methods*required
attributeFontFont for select methods*required

Examples

color($.label, 'wordInLabelToColor', '#000')
backgroundColor($.label, 'wordInLabelToChangeBackgroundColor', '#000')
underline($.label, 'wordInLabelToUnderline', Ti.UI.ATTRIBUTE_UNDERLINE_STYLE_THICK) // 3rd parameter optional
underlineAndColor($.label, 'underlineAndColor', '#F1F1F1')
bold($.label, 'wordInLabelToBold', { fontFamily: 'Helvetica-Bold', fontSize: 20 })
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago