Wednesday, November 18, 2015

ရွည္လ်ားေသာ text ကို scrollview မသံုးပဲ editText ျဖင့္ display လုပ္ျခင္း

ရွည္လ်ားေသာ text ကို scrollview မသံုးပဲ editText ျဖင့္ display လုပ္ျခင္း

အရင္ project ေတြမွာ text ရွည္ေနရင္ scrollview+ label သံုးၿပီး display လုပ္ျပခဲ့ပါတယ္။ ဒီမွာ ျပႆ      နာက label height ကို မွန္းၿပီး set လုပ္ေနရတယ္။ တခ်ိဳ႕ ဖုန္းေတြမွာ လြဲေနႏိုင္တယ္။

အခု editText နဲ႔ display လုပ္မယ္ ဆိုရင္ scrollview, label မလိုေတာ့ဘူး။ height အတြက္ ဦးေႏွာက္ မစားေတာ့ဘူး။ ဒါေပမဲ့ editText ကို touch လုပ္မိရင္ ကီးဘုတ္ တက္မလာေအာင္ 

SetInputType("et1",0)

ဆိုၿပီး ပိတ္ေပးထားရပါမယ္။

Multiline ျဖစ္ေအာင္

SetSingleLine("et1",false)

ဆိုၿပီး ေရးေပးထားရပါမယ္။

ဒီမွာ txt="...... text အရွည္ႀကီး ေရးထားပါတယ္။ code မဟုတ္ပါဘူး ......."

(မဟာဘုတ္ ေဗဒင္ project မွာ သံုးၾကည့္ပါ။)

Main
=====
AddEditText("et1",0,50%y ,100%x,50%y,"")
setinputtype("et1",0)
setsingleline("et1",false)
setcolor("et1",30,cGold)

# ################

txt=" *** EditText functions

'EditText supports these functions in addition to the View and TextView functions.

'Gets the selection start position (or the cursor position) of the EditText.
'Returns -1 if there is no selection or cursor.
Sub GetSelectionStart(name As String)

'Force the EditText virtual keyboard action key to display Done by setting this value to True.
Sub SetForceDoneButton(name As String, forcestate As String)

'Set the text that will appear when the EditText is empty.
Sub SetHint(name As String, hint As String)

'Set the color of the text that will appear when the EditText is empty.
Sub SetHintColor(name As String, hintcolor As String)

'Set the value of the EditText InputType property.
'NONE = 0; TEXT = 1; NUMBERS = 2; _PHONE = 3; DECIMAL_NUMBERS = 12290;
Sub SetInputType(name As String, inputtype As String)

'Set the value of the EditText PasswordMode property.
Sub SetPasswordMode(name As String, state As String)

'Sets the selection start position (or the cursor position) of the EditText.
Sub SetSelectionStart(name As String, selectionstart As String)

'Set the value of the EditText SingleLine property.
Sub SetSingleLine(name As String, state As String)

'Set the value of the EditText Wrap property.
Sub SetWrap(name As String, state As String)

=========================="

# ##############

settext("et1",txt)

==========
Events
==========

Sub Activity_Pause(UserClosed)
End Sub

Sub Activity_Resume
End Sub

Sub Edit_Change(Who, Old, New)
End Sub

Sub edit_enterpressed(who)
End Sub

=========

No comments:

Post a Comment