当前位置:K88软件开发文章中心编程语言B4AB4A01 → 文章内容

B4A显示一个message对话框

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2019-1-6 12:54:32

例如:
For i = 0 To Activity.NumberOfItems - 1
If Activity.GetItem(i) Is Button Then
Dim b As Button
b = Activity.GetItem(i)
b.Color = Colors.Blue
End If
Next
IsBackgroundTaskRunning (ContainerObject As Object, TaskId As Int) As Boolean
检测一个容器中指定的id的sub是否在后头运行
IsNumber (Text As String) As Boolean
检测指定的字符串能否安全的转换为数字
LastException As Exception
获取最后捕捉的异常
LoadBitmap (Dir As String, FileName As String) As Bitmap
载入一个Bitmap
注意安卓的文件系统是区分大小写的
如果Bitmap图片太大,可能需要使用LoadBitmapSample
图片通常压缩存储,与实际文件大小无关
例如:
Activity.SetBackgroundImage(LoadBitmap(File.DirAssets, "SomeFile.jpg"))
LoadBitmapSample (Dir As String, FileName As String, MaxWidth As Int, MaxHeight As Int) As
Bitmap
载入bitmap.
如果bitmap的实际高度或宽度大于最大尺寸,将进行采样
这样在载入大图片时将会节省大量的内存
例如:
Activity.SetBackgroundImage(LoadBitmapSample(File.DirAssets, "SomeFile.jpg",
Activity.Width, Activity.Height))
Log (Message As String)
打印一条日志信息.
Message: 日志的信息.
Logarithm (Number As Double, Base As Double) As Double
Max (Number1 As Double, Number2 As Double) As Double
Returns the larger number between the two numbers.
Min (Number1 As Double, Number2 As Double) As Double
Returns the smaller number between the two numbers.
Msgbox (Message As String, Title As String)
显示一个message对话框
对话框将只显示一个ok按钮
Example:
Msgbox("Hello world", "This is the title")
Msgbox2 (Message As String, Title As String, Positive As String, Cancel As String, Negative As
String, Icon As android.graphics.Bitmap) As Int
显示一个message对话框


B4A显示一个message对话框