سلام یه مشکل دارم تو کدنویسی میخوام وقتی منو اسلاید باز میشه مثلا رویدرباره ی ما کلیک کنم وارد یه اکتیویتی جدید بشم نمیدونم چکار کنم این از کد من
[size=4]Version=2.71
IconFile=
NumberOfModules=0
Package=b4a.example
DoNotOverwriteManifest=False
ManifestCode='This code will be applied to the manifest file during compilation.~\n~'You do not need to modify it in most cases.~\n~'See this link for for more information: http://www.basic4ppc.com/forum/showthread.php?p=78136~\n~AddManifestText(~\n~<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>~\n~<supports-screens android:largeScreens="true" ~\n~ android:normalScreens="true" ~\n~ android:smallScreens="true" ~\n~ android:anyDensity="true"/>)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~'End of default text.~\n~
UserTypesHint=
NumberOfFiles=1
File1=main.bal
NumberOfLibraries=2
Library1=core
Library2=sidemenubar
@EndOfDesignText@
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim menu As SideMenuBar
Dim a As Typeface
Dim b As Bitmap
Dim i As Int = 0
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
b.Initialize(File.DirAssets,"logo.png")
a = Typeface.LoadFromAssets("dastnevis.otf")
menu.Initialize("gh",Me,50%x,True,a,Colors.RGB(184,163,0),b,1,Colors.Black)
menu.add_item("صفحه اصلی","",LoadBitmap(File.DirAssets,"Home.png"),1)
menu.add_item("درباره ما","",LoadBitmap(File.DirAssets,"person-icon.png"),2)
menu.add_item("ارتباط با ما","",LoadBitmap(File.DirAssets,"telephone-icon.png"),3)
menu.add_item("خروج","",LoadBitmap(File.DirAssets,"exit.png"),4)
menu.make(Activity)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub b_show_Click
If i = 0 Then
menu.show
Else
menu.hide
End If
End Sub
Sub gh_Opened()
i = 1
End Sub
Sub gh_Closed()
i = 0
End Sub
Sub gh_Click(Item As Object)
ToastMessageShow("Item clicked: " & Item, False)
End Sub
[/size]
بعدش یه سوال دیگه آیا میشه بک گراند خود من و اسلاید هم عوض کرد?
سوال
محمدی 95
سلام یه مشکل دارم تو کدنویسی میخوام وقتی منو اسلاید باز میشه مثلا رویدرباره ی ما کلیک کنم وارد یه اکتیویتی جدید بشم نمیدونم چکار کنم این از کد من
[size=4]Version=2.71 IconFile= NumberOfModules=0 Package=b4a.example DoNotOverwriteManifest=False ManifestCode='This code will be applied to the manifest file during compilation.~\n~'You do not need to modify it in most cases.~\n~'See this link for for more information: http://www.basic4ppc.com/forum/showthread.php?p=78136~\n~AddManifestText(~\n~<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>~\n~<supports-screens android:largeScreens="true" ~\n~ android:normalScreens="true" ~\n~ android:smallScreens="true" ~\n~ android:anyDensity="true"/>)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~'End of default text.~\n~ UserTypesHint= NumberOfFiles=1 File1=main.bal NumberOfLibraries=2 Library1=core Library2=sidemenubar @EndOfDesignText@ #Region Project Attributes #ApplicationLabel: B4A Example #VersionCode: 1 #VersionName: 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: unspecified #CanInstallToExternalStorage: False #End Region #Region Activity Attributes #FullScreen: False #IncludeTitle: True #End Region Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. End Sub Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim menu As SideMenuBar Dim a As Typeface Dim b As Bitmap Dim i As Int = 0 End Sub Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("main") b.Initialize(File.DirAssets,"logo.png") a = Typeface.LoadFromAssets("dastnevis.otf") menu.Initialize("gh",Me,50%x,True,a,Colors.RGB(184,163,0),b,1,Colors.Black) menu.add_item("صفحه اصلی","",LoadBitmap(File.DirAssets,"Home.png"),1) menu.add_item("درباره ما","",LoadBitmap(File.DirAssets,"person-icon.png"),2) menu.add_item("ارتباط با ما","",LoadBitmap(File.DirAssets,"telephone-icon.png"),3) menu.add_item("خروج","",LoadBitmap(File.DirAssets,"exit.png"),4) menu.make(Activity) End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub b_show_Click If i = 0 Then menu.show Else menu.hide End If End Sub Sub gh_Opened() i = 1 End Sub Sub gh_Closed() i = 0 End Sub Sub gh_Click(Item As Object) ToastMessageShow("Item clicked: " & Item, False) End Sub [/size]بعدش یه سوال دیگه آیا میشه بک گراند خود من و اسلاید هم عوض کرد?
لینک ارسال
به اشتراک گذاری در سایت های دیگر
9 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.