It seems there is not a function to cast iconbutton as view there.
If you are able to solve this problem the library will be more complete.
Sub IconButton_Click()
Log("Button click")
Dim ib As IconButton = Sender
Log(ib.Tag)
End Sub
I dont know. But i know the IconButton has no problem with Android 5 regarding visible state (my S6 EDGE is using Android 5)Am I in the right track ?
IconButton
Version: 1.11
- IconButton
Events:Methods:
- Click()
- Down()
- HoverEnter()
- HoverExit()
- LongClick()
- Up()
Properties:
- AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
programmatically add the view (the Button)- DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
- Initialize (EventName As String)
- setIcon (LeftSide As Boolean, d As Drawable)
- setPadding (left As Int, top As Int, right As Int, bottom As Int)
Sets the Padding for this Button
- Background As Drawable [write only]
Sets the Buttons background- BackgroundColor As Int [write only]
Sets the Buttons background color- BackgroundDrawable As Drawable [write only]
Sets the Buttons background drawable (deprecated)- Enabled As Boolean [write only]
Sets the Buttons enabled state- Height As Int
- IconPadding As Int [write only]
Set the Padding between Text and Icon- Left As Int
- Text As String [write only]
Set the Text- TextAlignment As Void
Sets the Alignment for this Button- TextColor As Int [write only]
Sets the Textcolor for this Button- Top As Int
- Typeface As Typeface
Sets the Typeface for this Button- Width As Int
B4X:Dim bm As BitmapDrawable bm.Initialize(LoadBitmap(File.DirAssets,"ic_action_alarm.png")) ib1.Text = "Button" ib1.IconPadding = 50 ib1.setIcon(True,bm) Dim bm As BitmapDrawable bm.Initialize(LoadBitmap(File.DirAssets,"ic_action_achievement.png")) ib2.Text = "Button" ib2.IconPadding = 50 ib2.setIcon(False,bm) Dim bm As BitmapDrawable bm.Initialize(LoadBitmap(File.DirAssets,"ic_action_android.png")) ib3.Text = "Button" ib3.IconPadding = 50 ib3.setIcon(False,bm)
Not really, just downloaded, there is still no iconsi have replaced the example-zip (including icons)
I just did a download of the example from post #1. The icons ARE in the files folderNot really, just downloaded, there is still no icons
The underlying Library does not expos a method to change the position to top or bottom.Any chance set icon possition on top or bottom ?
Sub ib1_Down()
Log("down")
End Sub
Sub ib1_Up()
Log("up")
End Sub
Sub ib1_HoverEnter()
Log("hover enter")
End Sub
Sub ib1_HoverExit()
Log("hover exit")
End Sub
Probably nothing.What am I doing wrong?
IconButton
Version: 1.11
- IconButton
Events:Methods:
- Click()
- Down()
- HoverEnter()
- HoverExit()
- LongClick()
- Up()
Properties:
- AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
programmatically add the view (the Button)- DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
- Initialize (EventName As String)
- setIcon (LeftSide As Boolean, d As Drawable)
- setPadding (left As Int, top As Int, right As Int, bottom As Int)
Sets the Padding for this Button
- Background As Drawable [write only]
Sets the Buttons background- BackgroundColor As Int [write only]
Sets the Buttons background color- BackgroundDrawable As Drawable [write only]
Sets the Buttons background drawable (deprecated)- Enabled As Boolean [write only]
Sets the Buttons enabled state- Height As Int
- IconPadding As Int [write only]
Set the Padding between Text and Icon- Left As Int
- Text As String [write only]
Set the Text- TextAlignment As Void
Sets the Alignment for this Button- TextColor As Int [write only]
Sets the Textcolor for this Button- Top As Int
- Typeface As Typeface
Sets the Typeface for this Button- Width As Int
B4X:Dim bm As BitmapDrawable bm.Initialize(LoadBitmap(File.DirAssets,"ic_action_alarm.png")) ib1.Text = "Button" ib1.IconPadding = 50 ib1.setIcon(True,bm) Dim bm As BitmapDrawable bm.Initialize(LoadBitmap(File.DirAssets,"ic_action_achievement.png")) ib2.Text = "Button" ib2.IconPadding = 50 ib2.setIcon(False,bm) Dim bm As BitmapDrawable bm.Initialize(LoadBitmap(File.DirAssets,"ic_action_android.png")) ib3.Text = "Button" ib3.IconPadding = 50 ib3.setIcon(False,bm)
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?