f = su.MeasureMultilineTextHeight(Label1,Label1.Text)
این هم سورس . اگه میشه کمک کنید . میخوام تا فردا برنامم درست شه
#Region Activity Attributes
#FullScreen: True
#IncludeTitle: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim s As SQL
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 ScrollView1 As ScrollView
Dim ts As TextSetting
Dim Ln As LNsetting
Dim Da As ColorPickerDialog
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("InfoJK_Matlab")
If File.Exists(File.DirInternal,"Joke-db.db") = False Then
File.Copy(File.DirAssets,"Joke-db.db",File.DirInternal,"Joke-db.db")
End If
If s.IsInitialized=False Then
s.Initialize(File.DirInternal,"Joke-db.db",False)
End If
ScrollView1.Initialize(800dip)
Dim cur1 As Cursor
cur1 = s.ExecQuery("SELECT * FROM Mytable where id="&InfoJK.fasl)
cur1.Position=0
Activity.AddView(ScrollView1,0,0,100%x,100%y)
Dim Label1 As Label
Label1.Initialize("Label1")
Label1.Text = cur1.GetString("matn")
ScrollView1.Panel.AddView(Label1,10dip,0,95%x,ScrollView1.Height)
ScrollView1.Color=Colors.ARGB(255,191, 85, 236)
Dim su As StringUtils
Dim f As Float
'=====================================================
Label1.Width = -2
Label1.Height = -2
'=====================================================
f = su.MeasureMultilineTextHeight(Label1,Label1.Text)
Label1.Height = f
ScrollView1.Height=ScrollView1.Panel.Height
ScrollView1.Panel.Height=f+80%y
Try
Label1.TextColor = Ln.get("n","Color")
Label1.TextSize = Ln.get("n","Size")
Label1.Typeface = Typeface.LoadFromAssets(Ln.get("n","Font"))
Catch
End Try
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
سوال
Assassin-Wolf 13
دوستان . من نمیتونم Label ام رو Auto Size کنم وقتی این کد ها رو اضافه میکنم
این مشکل در برنامه به وجود میاد
و وقتی به صورت Debug هست از این خط مشکل میگیره
این هم سورس . اگه میشه کمک کنید . میخوام تا فردا برنامم درست شه
#Region Activity Attributes #FullScreen: True #IncludeTitle: False #End Region Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. Dim s As SQL 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 ScrollView1 As ScrollView Dim ts As TextSetting Dim Ln As LNsetting Dim Da As ColorPickerDialog 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("InfoJK_Matlab") If File.Exists(File.DirInternal,"Joke-db.db") = False Then File.Copy(File.DirAssets,"Joke-db.db",File.DirInternal,"Joke-db.db") End If If s.IsInitialized=False Then s.Initialize(File.DirInternal,"Joke-db.db",False) End If ScrollView1.Initialize(800dip) Dim cur1 As Cursor cur1 = s.ExecQuery("SELECT * FROM Mytable where id="&InfoJK.fasl) cur1.Position=0 Activity.AddView(ScrollView1,0,0,100%x,100%y) Dim Label1 As Label Label1.Initialize("Label1") Label1.Text = cur1.GetString("matn") ScrollView1.Panel.AddView(Label1,10dip,0,95%x,ScrollView1.Height) ScrollView1.Color=Colors.ARGB(255,191, 85, 236) Dim su As StringUtils Dim f As Float '===================================================== Label1.Width = -2 Label1.Height = -2 '===================================================== f = su.MeasureMultilineTextHeight(Label1,Label1.Text) Label1.Height = f ScrollView1.Height=ScrollView1.Panel.Height ScrollView1.Panel.Height=f+80%y Try Label1.TextColor = Ln.get("n","Color") Label1.TextSize = Ln.get("n","Size") Label1.Typeface = Typeface.LoadFromAssets(Ln.get("n","Font")) Catch End Try End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Subلینک ارسال
به اشتراک گذاری در سایت های دیگر
10 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.