when I used 1.4 test some,it's ok
when I download the 1.8
I test some old app, it's ok
I write a new ,like this
it's can't used
when I download the 1.8
I test some old app, it's ok
I write a new ,like this
B4X:
'Code module
#Region Project Attributes
#ApplicationLabel: cards
#Version: 1.0.0
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Dim bmpHand As Bitmap
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.Black '.White
NavControl.ShowPage(Page1)
Page1.RootPanel.LoadLayout("suanpai")
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
For I = 0 To 9 'create 10 imageviews
Dim btn As Button
btn.Initialize ("Btn")
bmpHand.Initialize( File.DirAssets ,I&"card.png")
SetBackgroundImage(btn,bmpHand,0)
Page1.RootPanel.AddView(btn, 0dip+10%x*I, 100%y-100dip, 15%x, 100dip)
Next
End Sub
Private Sub Application_Background
End Sub
'state: 0 - normal, 1 - highlighted, 2 - disabled
Sub SetBackgroundImage(b As Button, bmp As Bitmap, state As Int)
Dim no As NativeObject = b
no.RunMethod("setBackgroundImage:forState:", Array(bmp, state))
End Sub
it's can't used