Android Question IconButton issue layout properties showing error.

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi,

I have migrated my code from 5.0 to 8.5. Iconbutton is having some issue in assigning LEFT property where as VISIBLE is working for same button as in below code.

B4X:
For Each v As View In pnl.GetAllViewsRecursive
If v Is IconButton Then
    Button1=v
    If Button1.Visible=True  Then 'working
        If j=0 Then
            Button1.Left=nDistance 'not working
        Else
            Button1.Left=(j+1)*nDistance+(j)*nOnebtnWidth
        End If
        j=j+1
    End If
End If
Next

I tried by deleting and creating all controls in designer, I also declared Button1 in global for this to work. but still shows below error

Panel size is unknown. Lyout may not be loaded correctly.

java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams com.phillipcalvin.iconbutton.IconButton.getLayoutParams()' on a null object reference

Pls give some clue.

Thanks
Juzer[/code]
 
Last edited:

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi Erel,

Attached is a test project which has the same issue with IconButton.

Juzer
 

Attachments

  • TestProjects.zip
    414.8 KB · Views: 184
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
Luckily i am not arranging iconbuttons in this project elsewhere,
I can use either Imageview(it has click event) or FontAwesome.

Thank You Erel,

Juzer
 
Upvote 0
Top