Encountered Error in ListView

mjtaryan

Active Member
Licensed User
Longtime User
In the main activity of an app I'm working on I have the following line

58 lstMenu.TwoLinesLayout.Label.Typeface = Typeface.STYLE_BOLD

When I attempt to compile the app I get the following error message.

Compiling code. 0.03
Compiling layouts code. 0.02
Generating R file. 0.00
Compiling generated Java code. Error
B4A line: 58
lstMenu.TwoLinesLayout.Label.Typeface = Typeface.STYLE_BOLD
javac 1.6.0_26
src\com\chirhomedia\dmnovena\main.java:411: inconvertible types
found : int
required: android.graphics.Typeface
mostCurrent._lstmenu.getTwoLinesLayout().Label.setTypeface((android.graphics.Typeface)(anywheresoftware.b4a.keywords.Common.Typeface.STYLE_BOLD));
^
1 error


Why and how do I correct it? Note the offending line was created following sample code in this post -- http://www.b4x.com/forum/basic4android-updates-questions/15875-how-set-view-text-bold.html#post90227

Thanks.
 

kickaha

Well-Known Member
Licensed User
Longtime User
Try using
B4X:
ListView1.TwoLinesLayout.Label.Typeface = Typeface.DEFAULT_BOLD

as STYLE_BOLD is an integer, whereas DEFAULT_BOLD is a Typeface.
 
Upvote 0

mjtaryan

Active Member
Licensed User
Longtime User
Try using
B4X:
ListView1.TwoLinesLayout.Label.Typeface = Typeface.DEFAULT_BOLD

as STYLE_BOLD is an integer, whereas DEFAULT_BOLD is a Typeface.

That seems rather confusing as well as inconsistent, particularly since DEFAULT_BOLD and STYLE_BOLD both are listed in the same properties list from which the latter was selected. However, I will try what you suggest.
 
Upvote 0
Top