iOS Question Search View

Discussion in 'iOS Questions' started by Marco Maria Vilucchi, Jun 25, 2015.

  1. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    Hi.
    i'm trying to use the class in the link (by Erel).

    http://www.b4x.com/android/forum/threads/class-searchview.48576/#content

    I have 2 needs.

    1) I would at the start, like in case of selectedchanged, that listview (lv) was not visible
    2) I want to change listview color

    In both cases if I add istrucions the App wait many seconds to show listview and then doesn't consider the istuctions.
    I modified your code.
    Here the code.

    Case 1
    Code:
    Private Sub et_TextChanged (Old As String, New As String)
    lv.Clear
    If lv.Visible = False Then lv.Visible = True
    If et.Text=Null Then lv.Visible = False '<=== I insert This istruction
    FillList(New)
    End Sub
    Case 2
    Code:
    Public Sub Initialize (Callback As Object, EventName As String)
    et.Initialize(
    "et")
    et.ShowClearButton = 
    True
    lv.Initialize(
    "lv"False)
    lv.Visible = 
    False
    lv.Color=
    Colors.LightGray '<==== I insert this istruction
    prefixList.Initialize
    substringList.Initialize
    mCallback = Callback
    mEventName = EventName
    End Sub
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Moved to B4i forum.

    Click on Tools - Clean Project. It will force the IDE to do a full compilation and it will be fast again.
     
  3. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    no, sorry, it isn't the matter.
    Try Case 2 to your code (just an istruction).
    It doesn't work
    No color is added

    About Case 1 how can I have lv not visible at start of App?
    it seems that the App feel always TextChanged although not change
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Remove this code to hide the list when there is no text:
    Code:
    If new.Length < MIN_LIMIT Then
         AddItemsToList(allItems, 
    "")
         
    Return
       
    End If
    Changing the color is more complicated. You will need to use custom cells instead of the standard cells.
     
Loading...