tabbar goes up along with keyboard
This has been posted before but no answers.
Problem:
TabBar
--> (2 tabs)
- tab one has a
Scrollview
and anEddiText
- 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>
精彩评论