开发者

tabbar goes up along with keyboard

开发者 https://www.devze.com 2023-03-16 15:12 出处:网络
This has been posted before but no answers. Problem: TabBar --> (2 tabs) tab one has a Scrollview and an EddiText

This has been posted before but no answers.

Problem:

TabBar --> (2 tabs)

  • tab one has a Scrollview and an EddiText
  • tab two: something else

When taping the EditText, th开发者_Python百科e soft keyboard goes up and TabBar along with it.

(An ugly solution would be to disable scrolling in ScrollView)

Any decent solution to this?!


A simple solution would be to tell the TabBar to adjust for Softkeyboard Mode. To do this, go to your manifest file, and in the Tabbar Activity add this line,

android:windowSoftInputMode="adjustPan"

This makes your Tabbar to stay at the bottom even when the softkeyboard is visible.


Update: Ignore answer, thought you were using Adobe Flex for Android (dont know why!!) This works, hides the tabbar on soft/virtual keyboard being activated, and makes it visible again when its deactivated.

The listeners could be added on a global application level http://bbishop.org/blog/?p=524.

<?xml version="1.0" encoding="utf-8"?>

<fx:Script>
    <![CDATA[
        import mx.core.FlexGlobals;
        protected function textinput1_softKeyboardActivatingHandler(event:SoftKeyboardEvent):void
        {
            // TODO Auto-generated method stub
            FlexGlobals.topLevelApplication.tabbedNavigator.tabBar.visible = false;
        }


        protected function textinput1_softKeyboardDeactivateHandler(event:SoftKeyboardEvent):void
        {
            // TODO Auto-generated method stub
            FlexGlobals.topLevelApplication.tabbedNavigator.tabBar.visible = true;
        }

    ]]>
</fx:Script>

<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Scroller id="scroller" left="10" right="10" top="10" bottom="70" >
    <s:VGroup paddingTop="3" paddingLeft="5" paddingRight="5" paddingBottom="3" horizontalAlign="center">

        <s:TextInput softKeyboardActivating="textinput1_softKeyboardActivatingHandler(event)"
                     softKeyboardDeactivate="textinput1_softKeyboardDeactivateHandler(event)"/>

    </s:VGroup>
</s:Scroller>

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号