Android - Layout Top Bar is pushed when key keyboard is shown - android

I have a simple layout with:
top bar (like action bar) with save and back button
and below a scroll view with some EditText inside... (check the image below),
When I call keyboard, my view is push above... I would like my Top Bar to stay always visible and fixed on the top... (check below the image of what is happening and what I would like to happen)
I tried several solutions with android:windowSoftInputMode, putting the top bar as relative layout and set isScrollContainer in scrollview but none have worked for me...
Code Below:
<RelativeLayout
android:id="#+id/llWriteCommentWall"
style="#style/TextSubSeparator"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
style="#style/TextSubSeparator"
android:layout_marginBottom="#dimen/margin_separator_bottom"
android:layout_alignParentTop="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="left|center_horizontal|center_vertical"
android:orientation="horizontal"
android:layout_marginTop="#dimen/margin_title_top"
android:layout_marginBottom="#dimen/margin_title_bottom"
android:layout_marginLeft="#dimen/margin_title_left"
android:layout_marginRight="#dimen/margin_title_right"
>
<ImageView
android:id="#+id/ivMainMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="#drawable/tk_btn_home"
android:onClick="clickHome"/>
</LinearLayout>
<TextView
android:id="#+id/tvSeconHeader"
android:text="#string/title"
android:layout_width="match_parent"
android:layout_weight="2.5"
android:layout_height="match_parent"
android:gravity="center"
style="#style/TextTileHealth"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="right|center_horizontal"
android:orientation="horizontal"
android:layout_marginTop="#dimen/margin_title_top"
android:layout_marginBottom="#dimen/margin_title_bottom"
android:layout_marginLeft="#dimen/margin_title_left"
android:layout_marginRight="#dimen/margin_title_right">
<ImageView
android:id="#+id/ivSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="#drawable/tk_btn_tab_save"
android:onClick="clickSave"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:isScrollContainer="false">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/margin_separator_bottom"
android:gravity="center">
<!-- EditBoxes -->
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText
android:id="#+id/et1"
style="#style/TextEditBox"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:digits="0123456789."
android:inputType="numberDecimal"
android:maxLength="3"
android:layout_weight="0.33"
android:gravity="center"
android:ems="3"
android:layout_marginBottom="10dp"/>
<EditText
android:id="#+id/et2"
style="#style/TextEditBox"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:digits="0123456789."
android:inputType="numberDecimal"
android:maxLength="3"
android:layout_weight="0.33"
android:gravity="center"
android:ems="3"
android:layout_marginBottom="10dp"/>
<EditText
android:id="#+id/et3"
style="#style/TextEditBox"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:digits="0123456789."
android:inputType="numberDecimal"
android:maxLength="3"
android:layout_weight="0.33"
android:gravity="center"
android:ems="3"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
And Manifest:
<activity
android:name="com.example.slyzer.gui.new.NewValue"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait">
</activity>
EDIT:
I recently find out, that when you put the activity as Full Screen:
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
, the windows starts to act different from usual:
https://code.google.com/p/android/issues/detail?id=5497&q=fullscreen&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars
and as described by Dianne Hackborn in here, this is how it's working, and it seems that there is no interest in changing it.
So, I tried the Joseph Johnson's AndroidBug5497Workaround, but I always end up with a "extra" blank bar above my keyboard, and the View steel doesn't show as I want it to...
Does anyone have a nice/simple solution to this problem?

android:windowSoftInputMode="adjustResize" in the manifest for your activity will keep the top bar in view and resize the scrollview to use what room is left.
The only issue I can see with this would be lining up the edit text with the viewable area after it has been resized (if this is needed)

Add this to the activity tag in the manifest:
android:windowSoftInputMode="adjustPan"
Or programmatically:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

Related

How can I prevent FrameLayout from shadowing my Views?

My interface looks like this:
XML:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/profile_fields_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/account_person_name_label" />
<EditText
android:id="#+id/person_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="150dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="#string/account_person_emailId_label" />
<EditText
android:id="#+id/person_emailId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:minWidth="150dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="#string/account_person_phoneNo_label" />
<EditText
android:id="#+id/person_phoneNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="phone"
android:maxLength="10"
android:minWidth="150dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="#string/account_person_password_label" />
<EditText
android:id="#+id/password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:minWidth="150dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="#string/account_person_retypePassword_label" />
<EditText
android:id="#+id/retype_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:minWidth="150dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/learner_tutor_status_label" />
<android.support.v7.widget.AppCompatSpinner
android:id="#+id/learner_tutor_status_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
<!--Floating Button-->
<Button
android:id="#+id/create_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:text="#string/create_account_string"
style="#style/Widget.AppCompat.Button.Colored"/>
</FrameLayout>
Now, you can see at the bottom there is I am here to.... This is a dropdown and when I choose one of the options, my code dynamically adds a few views to the hierarchy but the problem is they are not visible(not all of them; just I am a... is visible.)
I checked the layout hierarchy through the Layout inspector and turns out that the hierarchy is alive but the floating button(Create Account) has overshadowed it.
Now, I know if I were to replace the root FrameLayout with a LinearLayout, it would be visible but the problem is that if then I would click on a EditText button, the keypad would cover the screen with the Create Account button as covered too. I actually want this button to be on the screen at all times.
Does anyone how can I get around this problem?
Your layout is not totally correct because your floating button hides the bottom of your ScrollView all the time. You should replace the FrameLayout with a vertical LinearLayout (just like you said) and then specify the window behavior of your activity when the soft keyboard pops up with the windowSoftInputMode attribute in your activity element on the AndroidManifest.xml file. If you use android:windowSoftInputMode="adjustResize", the window will resize accordingly and the button should be always visible.

Dialog is partially shown when SoftKeyBoard is shown

I have a custom Dialog as shown below:
When I click on the Edit Text, The dialog is shifted upwards but half of the dialog becomes invisible as shown below:
I verified the issue on Android ICS and Gingerbread but it doesn't happen on Android Lollipop.
I appreciate your help for figuring out why.
Here is the custom dialog layout XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layoutChatInGame"
android:layout_width="305dp"
android:layout_height="190dp"
android:background="#drawable/dialog_table_border"
android:orientation="vertical"
android:visibility="visible">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/roomlist_title_background">
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/progressBar"
android:layout_margin="5dp"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_margin="5dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Game is on hold because the host paused the app"
android:id="#+id/lblOnHoldDialogMessage"
android:textColor="#color/progress_dialog_on_hold_text"
android:textSize="18dp"
android:singleLine="false"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/lblChatHistoryGameOnHold"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="bottom"
android:maxLines="5"
android:scrollbars="vertical"
android:textColor="#color/edit_text_general_text"
android:textColorHint="#color/edit_text_general_hint"
android:paddingRight="2dp"
android:paddingLeft="2dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/textChatGameOnHold"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:ems="10"
android:hint="#string/edit_text_send_chat_message"
android:imeOptions="flagNoExtractUi|actionDone"
android:inputType="text"
android:maxLength="100"
android:maxLines="1"
android:textColor="#color/edit_text_general_text"
android:textColorHint="#color/edit_text_general_hint"/>
<Button
android:id="#+id/btnSendGameOnHold"
style="#style/lightboxButton.Blue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="sendChatMessageInGame"
android:text="#string/btn_send"/>
</LinearLayout>
</LinearLayout>
Try to use also android:imeOptions="flagNoFullscreen" in your .xml. Recommend you to make some tests, using it with and without flagNoExtractUi. Please give me some feedback.
If all the other solutions are not working then try adding marginBottom in the top layout:
LinearLayout android:layout_marginBottom=20dp
You can get the desired behavior by making adjustResize flag for the windowSoftInputMode of the dialog in the manifest if your dialog is declared as an activity.
Like This:
android:windowSoftInputMode="adjustResize|stateHidden"
You can also directly try something like this directly on the dialog:
alertDialog.getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

MaterialDesignLibrary FloatButton

I'm updating an old existing app to be 4+ only and am trying to introduce a flavour of Material Design for < Lollipop. To that end, I am using MaterialDesignLibrary to add a few elements - in particular, the floating button.
The floating button displays OK, along with its animation, but I cannot get its bottom position displaying correctly.
Despite the recommendation that the component should be put in the right-bottom of the screen, I am trying to put the component in the right-bottom of my container wrapper... The right positioning works ok, but the bottom positioning seems to take from the wrong element.
Here is my xml for the section in the screen:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:layout_marginTop="10dip" >
<RelativeLayout
android:id="#+id/llFeelingContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/light_background"
android:baselineAligned="true"
android:orientation="vertical" >
<TextView
android:id="#+id/tvFeelingTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="3dip"
android:paddingLeft="5dip"
android:textSize="16sp" />
<View
android:id="#+id/vSeparatorTop"
android:layout_width="match_parent"
android:layout_height="1dip"
android:layout_below="#id/tvFeelingTitle"
android:background="#color/material_lightgreen_100" />
<LinearLayout
android:id="#+id/llCircleContentHolder"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="#id/vSeparatorTop"
android:baselineAligned="false"
android:orientation="horizontal"
android:paddingBottom="5dip"
android:paddingTop="3dip" >
<LinearLayout
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:gravity="center"
android:text="pain"
android:textSize="14sp"
android:textStyle="bold" />
<com.app.prohealth.extras.CircleDisplay
android:id="#+id/circlePain"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/circle_0"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:gravity="center"
android:text="energy"
android:textSize="14sp"
android:textStyle="bold" />
<com.app.prohealth.extras.CircleDisplay
android:id="#+id/circleMood"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/circle_0"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:gravity="center"
android:text="mood"
android:textSize="14sp"
android:textStyle="bold" />
<com.app.prohealth.extras.CircleDisplay
android:id="#+id/circleEnergy"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/circle_0"
android:gravity="center" />
</LinearLayout>
</LinearLayout>
<View
android:id="#+id/vSeparatorBottom"
android:layout_width="match_parent"
android:layout_height="1dip"
android:layout_below="#id/llCircleContentHolder"
android:background="#color/material_lightgreen_100" />
<TextView
android:id="#+id/tvFeelingSubTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/vSeparatorBottom"
android:paddingBottom="3dip"
android:paddingLeft="5dip"
android:text="How are you feeling now?"
android:textSize="16sp" />
</RelativeLayout>
<com.gc.materialdesign.views.ButtonFloat
android:id="#+id/buttonFloat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_marginTop="20dp"
android:background="#1E88E5"
materialdesign:animate="true"
materialdesign:iconDrawable="#drawable/fab_ic_add" />
</FrameLayout>
Here is a shot of where the Floating Button appears, and where it should appear:
You'll see in the code that I have tried negative margins and padding, but nothing I've tried has had any effect.
The Floating Button should appear aligned with the bottom of tvFeelingSubTitle; what has gone wrong?
UPDATE
The suggestion from mistwalker did work, in as much as the button now aligns itself to the bottom. However, it expands the height of the bottom container to match the height of the button:
I tried a number of different variations on the suggestion, which either squashed the button to fit a fixed height container, or overwrote the content completely.
The layout I am wanting to create is more like this:
Maybe this isn't possible and I'm wasting my time and yours...
What do you think?
Try putting
android:layout_below="#id/vSeparatorBottom"
android:align_baseline=#id/tvFeelingSubTitle
android:alignParentRight="true"
and remove the margin attributes plus the alignParentBottom one.
That should do it.
ADD:
About your second question - You are seeing that because your floating action button(FAB) is INSIDE your RelativeLayout.
Instead have FrameLayout as the outermost parent and the RelativeLayout (minus the FAB) and FAB as siblings.
Then adjust the style on the FAB to sit in the bottom right corner of your FrameLayout with layout_gravity=bottom|right and any margins you may want to add.

EditText in ListView is not editable

I am trying to build a form using an EditText view that is nested in a ListView. There are a couple of levels of RelativeLayout and LinearLayout objects between the ListView and the EditText, but from what I've read this shouldn't be a problem.
I've tried all I can think of. I have set android:windowSoftInputMode="adjustPan" in the AndroidManifest for my activity, and I have set android:descendantFocusability="beforeDescendants" for my ListView as well. I have even set that for all layout objects between the ListView and the EditText. However, none of this seems to work.
The main issue I have is the soft keyboard doesn't show up, and even when I double tap the text field to pull up the editing options I still cannot type anything into the EditText area. Am I just flat out using the wrong object control for this?
This is the layout code for my ListView object.
<ListView
android:id="#+id/FormlistView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="beforeDescendants"
style="#style/KelFormListView" />
This is the layout code for my form_list_item.xml file. This is the item that is displayed in the form list.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="120dp"
android:descendantFocusability="beforeDescendants">
<!-- Top Layout -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:weightSum="10"
android:descendantFocusability="beforeDescendants"
android:id="#+id/TopLayout">
<TextView
android:id="#+id/TitleTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="7"
android:gravity="center_vertical"
android:text="Headling Rent (pa)"
android:textSize="16dp"
style="#style/KelFormListItemLabel" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:weightSum="2"
android:descendantFocusability="beforeDescendants"
android:background="#color/formListItemValueBackgroundColor">
<ImageView
android:id="#+id/CurrencyIconView"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_weight="0"
android:src="#drawable/icon_currency_pound"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp" />
<EditText
android:id="#+id/ValueTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="right|center_vertical"
android:text="20,000"
android:textSize="16dp"
android:inputType="number"
android:focusableInTouchMode="true"
android:editable="true"
style="#style/KelFormListItemValue"/>
</LinearLayout>
</LinearLayout>
<!-- Bottom Layout -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:weightSum="10"
android:id="#+id/BottomLayout"
android:descendantFocusability="beforeDescendants"
android:layout_below="#+id/TopLayout">
<TextView
android:id="#+id/BottomTitleTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="7"
android:gravity="center_vertical"
android:text="Headling Rent (pa)"
android:textSize="16dp"
style="#style/KelFormListItemLabel" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:weightSum="2"
android:descendantFocusability="beforeDescendants"
android:background="#color/formListItemValueBackgroundColor">
<ImageView
android:id="#+id/BottomCurrencyIconView"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_weight="0"
android:src="#drawable/icon_currency_pound"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp" />
<EditText
android:id="#+id/BottomValueTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="right|center_vertical"
android:text="20,000"
android:textSize="16dp"
android:inputType="number"
android:focusableInTouchMode="true"
android:editable="true"
style="#style/KelFormListItemValue"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Ok, figured out my own issue. The primary issue had nothing todo with any of my code. The problem was actually the emulator it's self. When creating a new virtual device in Android ADV there is a settings called "Enable Keyboard", or something along those lines. This setting allows you to use your hardware keyboard with the emulator, but it prevents the soft keyboard from showing up. That was my problem.
In my opinion this setting can easily cause confusion since it's not until you display the advanced settings that it appears. This just seems to me to be a poor decision that someone over at Google has made. Yet another reason why iOS development is easier...in my opinion of-course.

How do I fix the layout size with a background picture properly in Android?

I need help with my layout.xml file size. I am probably missing something basic. I have created a search-function with a EditText, SearchButton and a ListView where I will display the search results.
Everytime you click on the EditText I need to make sure the background picture does'nt get resized when the softkeyboard is displayed, therefor my whole layout is placed in a ScrollView. That's basicly the only reason why I am using a ScrollView. But the ScrollView creates another problem aswell, look at the picture below:
http://tinypic.com/view.php?pic=6p3yix&s=6
For some reason my background picture refuses to fill the whole "background" area. Look at the bottom of the picture where it is black. So when I am testing on a phone with large screens it gets black at the bottom. How can I manage to fill the whole "background" area with my background-picture? Please help!
Edit: I have tested to use the layout.xml file without a ScrollView but have not made it work since without it, the the keyboard will change the size of the background picture. I have also tryed to use adjustPan in the android manifest file without any luck. Only solution that worked is with ScrollView, but now instead I get this problem with the background-pictures size... / Thanx!
My xml file:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="#+id/sorted_teams_scroll"
android:isScrollContainer="false">
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layout_search_task"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center|top"
android:orientation="vertical"
android:stretchColumns="1"
android:weightSum="1.0"
android:background="#drawable/orginalbild01"
>
<TableRow>
<TextView
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.05">
</TextView>
<EditText
android:id="#+id/search_task_field"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.65"
android:hint="#string/SearchTaskHint" />
<Button
android:id="#+id/search_task_button"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_weight="0.25"
android:text="#string/Search" />
<TextView
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.05" >
</TextView>
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="5dp" >
</TextView>
</TableRow>
<TableRow android:paddingLeft="40dp" >
<TextView
android:id="#+id/search_task_column_names"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.33"
android:textStyle="bold" >
</TextView>
<TextView
android:id="#+id/search_task_column_names1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.33"
android:textStyle="bold" >
</TextView>
<TextView
android:id="#+id/search_task_column_names2"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.33"
android:textStyle="bold" >
</TextView>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<ProgressBar
android:id="#+id/search_task_progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateOnly="true"
android:visibility="gone" />
</TableRow>
<TableRow
android:paddingLeft="18dp"
android:paddingRight="18dp"
>
<ListView
android:id="#+id/search_task_list"
android:layout_width="fill_parent"
android:layout_height="355dp"
android:gravity="left" />
</TableRow>
</TableLayout>
</ScrollView>
If you have problem only with keyboard then...
just try this to disable the layout resize when keyboard is popped up -
In your manifest file add this to your activity...
android:windowSoftInputMode="adjustPan"
Pls post complete code... in above code you set background for table layout.. how it will apply for full background.. post your code without scrollview...

Categories

Resources