Press on the image to return to the main documentation page.
T8TextSize
Written by ArminKH
List of types:
T8TextSize
T8TextSize
Events:
None
Members:
Ellipsize
(
TargetView
As
Object
,
EllipSizeMode
As
String
,
MarqueeRepeatLimit
As
Int
)
As
String
Initialize
As
String
IsInitialized
As
Boolean
MultiLineFitText
(
TargetView
As
Object
,
CanBeLarger
As
Boolean
)
As
String
MultiLineLimited
(
TargetView
As
Object
,
MaximumLineCount
As
Int
)
As
String
SetLineCount
(
TargetView
As
Object
,
MaximumLinesCount
As
Int
,
EllipsizeModeIfNeeded
As
String
,
MarqueeRepeatLimitIfNeeded
As
Int
)
As
String
SetLineSpace
(
TargetView
As
Object
,
Multiplier
As
Float
)
As
String
SingleLineAutoScale
(
TargetView
As
Object
,
Width
As
Int
,
TextSize
As
Int
)
As
String
SingleLineFitText
(
TargetView
As
Object
,
CanBeLarger
As
Boolean
)
As
String
Members description:
Ellipsize
(
TargetView
As
Object
,
EllipSizeMode
As
String
,
MarqueeRepeatLimit
As
Int
)
As
String
EllipSizeMode : Cut your text with choosen mode
Can Be "Start" or "Middle" or "End" or "Marquee"
MarqueeRepeatLimit:If you choose "Marquee" mode then you can choose marquee repeat count too
set -1 for repeat indefinitely or for stop marquee
--------------------------------------------------------------
Example:
Dim SmartString1 as SmartString
SmartString1.Initialize
SmartString1.Ellipsize(Label1,"Marquee",-1)
Example :
Dim T8TextSize1 as T8TextSize
T8TextSize1.Initialize
T8TextSize1.Ellipsize(TextView , "END" , 0)
Initialize
As
String
IsInitialized
As
Boolean
Tests whether the object has been initialized.
MultiLineFitText
(
TargetView
As
Object
,
CanBeLarger
As
Boolean
)
As
String
Fit your text in view as long as the height of text is NOT greater than height of the view
CanBeLarger: if this option be false then your text will be fitted just if your text height is more than height of the view
Example :
Dim T8TextSize1 as T8TextSize
T8TextSize1.Initialize
T8TextSize1.MultiLineFitText(TextView , True)
MultiLineLimited
(
TargetView
As
Object
,
MaximumLineCount
As
Int
)
As
String
Text size will be increased or decreased as long as the height of text is NOT greater than height of the view)
MaximumLineCount: line count can't be more than given maximum line count
Example :
Dim T8TextSize1 as T8TextSize
T8TextSize1.Initialize
T8TextSize1.MultiLineLimited(TextView , 3)
SetLineCount
(
TargetView
As
Object
,
MaximumLinesCount
As
Int
,
EllipsizeModeIfNeeded
As
String
,
MarqueeRepeatLimitIfNeeded
As
Int
)
As
String
LineCount: Cut your string if be larger than given number of line
EllipsizeModeIfNeeded : ellipsize your text if be larger than maximum size
MarqueeRepeatLimitIfNeeded: If you choose marquee mode for ellipsize then you can limit marquee repeat count too
Example :
Dim T8TextSize1 as T8TextSize
T8TextSize1.Initialize
T8TextSize1.SetLineCount(TextView , 2 , "END" , 0)
SetLineSpace
(
TargetView
As
Object
,
Multiplier
As
Float
)
As
String
Set spaces between lines
Example :
Dim T8TextSize1 as T8TextSize
T8TextSize1.Initialize
T8TextSize1.SetLineSpace(TextView ,0.75)
SingleLineAutoScale
(
TargetView
As
Object
,
Width
As
Int
,
TextSize
As
Int
)
As
String
Scale the text size of target view based on new width of view
The text will be always one line and the aspect ratio will be preserved
Text size will be increased as long as the height of text is NOT greater than the height of view
Width : The width of a view before any changes in its dimensions
TextSize : The text size of a view before any changes in its dimensions
Example :
Dim T8TextSize1 as T8TextSize
T8TextSize1.Initialize
T8TextSize1.SingleLineAutoScale(TextView , 100dip , 12)
SingleLineFitText
(
TargetView
As
Object
,
CanBeLarger
As
Boolean
)
As
String
Fit your text in view as long as the height of text is NOT greater than height of the view
The text will be always one line
CanBeLarger : if this option be false then your text will be fitted just if your text is more than 1 line
Example :
Dim T8TextSize1 as T8TextSize
T8TextSize1.Initialize
T8TextSize1.SingleLineFitText(TextView , True)
Top