iOS Question How to set a picker font size dependent on device, dynamically?

Discussion in 'iOS Questions' started by davepamn, Mar 30, 2015.

  1. davepamn

    davepamn Active Member Licensed User

    I have a dynamically created picker object instantiated. I need to determine the device type, iPhone or iPad, at run time, and change the font size of the data picker dependent on device type.

    Code:
    Dim oPicker As Picker
        oPicker.Initialize(
    "lbx" & iPickerCounter)
        oPicker.Tag=sTestId

        
    Dim myList As List
        myList.Initialize
        myList.Clear

        
    Dim oKeyValue As AttributedString
        
    dim sListText as string="Hello World"
        
    dim sListValue as string="1"

       oKeyValue.Initialize(sListText,oFont, 
    Colors.Black)
       oKeyValue.Tag=sListValue
       myList.add(oKeyValue)

       oPicker.SetItems(
    0,myList)

       ScrollViewInput.Panel.AddView(oPicker,
    10dip,iRowOffset-(oPicker.Height/2),90%x,500dip)
     
  2. narek adonts

    narek adonts Well-Known Member Licensed User

    try app.iPadDevice
     
  3. davepamn

    davepamn Active Member Licensed User

    Will you provide a code sample?
     
  4. narek adonts

    narek adonts Well-Known Member Licensed User

    For exemple

    Code:
    Private Sub Page1_Resize(Width As Int, Height As Int)
         
    If App.iPadDevice Then
            
    'your runtime design code for iPad
         Else
         
            
    'your runtime design code for iPhone

         
    End If
    End Sub
     
  5. davepamn

    davepamn Active Member Licensed User

    thanks
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice