Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-16905

Android: ScrollView automatically scrolls to TextField after click on switch or picker selection

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: Release 3.2.2
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      SDK 3.3.0, 3.2.2.GA, tested on Nexus S Android 2.3.6 and 4.1.2

      Description

      See code example below. Clicking on the switch, or making a picker selection causes the ScrollView to scroll back to the TextField, with apparently no way to prevent this behavior.

      var win = Ti.UI.createWindow({
      	windowSoftInputMode: Ti.UI.Android.SOFT_INPUT_STATE_ALWAYS_HIDDEN,
      	backgroundColor: 'black'});
      var scrollview = Ti.UI.createScrollView({
      	top:'0dp',
      	scrollType: 'vertical',
      	width: Ti.UI.FILL,
      	contentHeight: 'auto',
      	contentWidth: 'auto',
      	layout: 'vertical',
      	showVerticalScrollIndicator: true,
      	scrollingEnabled: true});
       
       
      var textfield = Ti.UI.createTextField({top: 10, right: 10, left: 10});
      scrollview.add(textfield);
       
      var Switch = Ti.UI.createSwitch({
      	top: '2000dp'
      });
      scrollview.add(Switch);
       
      var picker = Ti.UI.createPicker({
        top:'20dp'
      });
       
      var data = [];
      data[0]=Ti.UI.createPickerRow({title:'Bananas'});
      data[1]=Ti.UI.createPickerRow({title:'Strawberries'});
      data[2]=Ti.UI.createPickerRow({title:'Mangos'});
      data[3]=Ti.UI.createPickerRow({title:'Grapes'});
       
      picker.add(data);
      picker.selectionIndicator = true;
      scrollview.add(picker);
       
      win.add(scrollview);	
      win.open();
      

        Attachments

          Activity

            People

            • Assignee:
              mchen Maggie Chen
              Reporter:
              mokesmokes Mark Mokryn
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-18665
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration