Android button click not fire - android

First of all sorry for my english, This is my first question on StackOverflow, but I've learned a lot here .
Now I have a problem, which I couldn't solve. I have a framelayout with some elements. In android 4.x, Menu Panel's buttons onClick method doesn't fire. menupanel work to be in scroolview but in android 2.x buttons and layout work without problem as i want. I didn't find a problem.
Thanks for the help!
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<!-- Menu Panel starts here -->
<RelativeLayout
android:scrollbars="none"
android:id="#+id/menuPanel"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#drawable/gray_bg"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="#+id/menu_title_1"
android:layout_width="fill_parent"
android:layout_height="45dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="0dp"
android:background="#353535"
android:gravity="center_vertical"
android:paddingLeft="15dp"
android:text="#string/menu_title"
android:textColor="#android:color/white"
android:textSize="20sp"
android:textStyle="bold" >
</TextView>
<View
android:id="#+id/menu_item_divider_5"
android:layout_width="fill_parent"
android:layout_height="0.5dp"
android:layout_below="#+id/menu_title_1"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#b5b5b5" />
<Button
android:id="#+id/aktifgorevlerim"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_below="#+id/menu_item_divider_5"
android:background="#drawable/buton"
android:gravity="center_vertical"
android:onClick="AYARLAR_Click"
android:paddingLeft="15dp"
android:text="#string/item_1"
android:textColor="#android:color/white" >
</Button>
<View
android:id="#+id/menu_item_divider_2"
android:layout_width="fill_parent"
android:layout_height="0.5dp"
android:layout_below="#+id/aktifgorevlerim"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#b5b5b5" />
<Button
android:id="#+id/tamamlanmisgorevlerim"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_below="#+id/menu_item_divider_2"
android:background="#drawable/buton"
android:gravity="center_vertical"
android:onClick="GOREVLERIM_Click"
android:paddingLeft="15dp"
android:text="#string/item_2"
android:textColor="#android:color/white" />
<View
android:id="#+id/menu_item_divider_1"
android:layout_width="fill_parent"
android:layout_height="0.5dp"
android:layout_below="#+id/tamamlanmisgorevlerim"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:background="#b5b5b5" />
<Button
android:id="#+id/hakkinda"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_below="#+id/menu_item_divider_1"
android:background="#drawable/buton"
android:gravity="center_vertical"
android:onClick="HAKKINDA_Click"
android:paddingLeft="15dp"
android:text="HAKKINDA"
android:textColor="#android:color/white" >
</Button>
<Button
android:id="#+id/cikisyap"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="0dp"
android:background="#drawable/buton2"
android:gravity="center_vertical"
android:onClick="CIKISYAP_Click"
android:paddingLeft="15dp"
android:text="#string/item_4"
android:textColor="#android:color/white" >
</Button>
</RelativeLayout>
<!-- menuPanel ends here -->
<ScrollView
android:id="#+id/scrolpanel"
android:layout_width="wrap_content"
android:fillViewport="false"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="#+id/slidingPanel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#android:color/white"
android:gravity="left"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="5dp"
android:background="#drawable/blue_bg" >
<View
android:id="#+id/header_vertical_divider_1"
android:layout_width="2dp"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_toRightOf="#+id/menuViewButton"
android:background="#drawable/engraved_bg" />
<ImageView
android:id="#+id/menuViewButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:clickable="true"
android:contentDescription="#string/description"
android:src="#drawable/icon_menu"
android:visibility="visible" />
<TextView
android:id="#+id/titlebar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Talep Detay Formu"
android:textColor="#color/White"
android:textSize="20sp" />
</RelativeLayout>
<EditText
android:id="#+id/Textgorevbaslik"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:ems="10"
android:gravity="top"
android:hint="Görev Başlığı"
android:textSize="10pt" >
<requestFocus />
</EditText>
<EditText
android:id="#+id/Textgorevaciklama"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="top"
android:hint="Açıklama"
android:lines="6"
android:singleLine="false"
android:textSize="10pt" >
</EditText>
<CheckBox
android:id="#+id/Checkgrupgorevi"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center"
android:onClick="CHECKBOX_click"
android:text="Grup Görevi mi ?" >
</CheckBox>
<Spinner
android:id="#+id/spinnergorevkisilistesi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center" />
<Spinner
android:id="#+id/spinnergorevprojelistesi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center" />
<Spinner
android:id="#+id/spinnergorevdurumlistesi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center" />
<CheckBox
android:id="#+id/Checkgorulmegorevi"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center"
android:text="Sadece Yönetici ve Uzman Görebilsin ?" >
</CheckBox>
<Spinner
android:id="#+id/spinnergorevonceliksirasi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center" />
<Button
android:id="#+id/btngorevekle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="#drawable/roundedbutton"
android:height="35dp"
android:onClick="GOREVEKLE"
android:text="EKLE"
android:textColor="#color/White"
android:textStyle="bold"
android:width="100dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:height="100dp"/>
</LinearLayout>
</ScrollView>
</FrameLayout>
onClick method
public void GOREVLERIM_Click(View view){
Intent intent = new Intent(GorevEkleActivity.this, GorevActivity.class);
startActivity(intent);
}

Thanks for answers. I found the solution. I put scrollview in a linearlayout. Problem was solved.
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<ScrollView
android:id="#+id/scrolpanel"
android:layout_width="match_parent"
android:fillViewport="false"
android:layout_height="match_parent"
android:orientation="vertical"
>
.
.
.
</ScrollView>
</LinearLayout>

Related

SlidingDrawer And ScrollView

I have a SlidingDrawer. And I want use ScrollView in my SlidingDrawer. I Try but app is not running.
I am tried ScrollView in LinearLayout but still not running app.
How can I do this.
Here İs Code:
.
.
.
.
.
.
<LinearLayout
android:id="#+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
<SlidingDrawer
android:layout_width="wrap_content"
android:layout_height="330dp"
android:content="#+id/content"
android:handle="#+id/handle"
android:id="#+id/slidingDrawer"
android:layout_gravity="center_horizontal"
android:padding="10dip">
<Button
android:id="#+id/handle"
android:layout_width="200dp"
android:layout_height="33dp"
android:text="== ÇÖZÜM =="
android:textSize="10dp"/>
<!-- I Try Add LinearLayout here But still not ronning.-->
<ScrollView
android:id="#+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ababab"
android:gravity="center|top"
android:padding="10dip">
.
.
.
.
.
.
</ScrollView>
</SlidingDrawer>
</LinearLayout>
THANKS!
This is my layout design that i had used in one of my project and it worked perfect check this :
<?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" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.wholesaleraja.touch_image.TouchImageZoom
android:id="#+id/singe_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:src="#drawable/raja" />
<RelativeLayout
android:id="#+id/det"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/single_item_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:padding="5dp"
android:text="Single Name"
android:textColor="#000000"
android:textSize="20sp"
android:textStyle="bold" />
<View
android:id="#+id/view"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_below="#+id/single_item_text"
android:background="#color/list_divider" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/view"
android:orientation="horizontal" >
<TextView
android:id="#+id/code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Product Code : "
android:textColor="#000000"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/code_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:textColor="#000000"
android:textSize="14sp" />
</LinearLayout>
<Button
android:id="#+id/price_tag"
style="#style/button_text"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="5dp"
android:layout_marginRight="5dp"
android:background="#drawable/price_button_background"
android:clickable="false"
android:padding="5dp"
android:text="Price"
android:textColor="#ffffff" />
</RelativeLayout>
<SlidingDrawer
android:id="#+id/SlidingDrawer"
android:layout_width="fill_parent"
android:layout_height="400dp"
android:layout_alignParentBottom="true"
android:content="#+id/contentLayout"
android:handle="#+id/slideButton"
android:orientation="vertical"
android:padding="0dip"
android:rotation="0" >
<ImageView
android:id="#+id/slideButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#drawable/up" />
<ScrollView
android:id="#+id/contentLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#e5e5e5" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="7dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lot Size : "
android:textSize="15sp" />
<TextView
android:id="#+id/lot_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1 "
android:textSize="15sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Piece(s)/Lot"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="10dp" >
<TableLayout
android:id="#+id/details"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/list_divider"
android:orientation="vertical"
android:stretchColumns="*" >
<TableRow
android:id="#+id/row3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Lot(s) "
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Discount"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Price/Lot"
android:textSize="22sp" />
</TableRow>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#color/list_divider" />
</TableLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Lot Qty : "
android:textSize="18sp" />
<Button
android:id="#+id/minus"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:background="#drawable/round_button"
android:text="-"
android:textSize="30sp"
android:textStyle="bold" />
<EditText
android:id="#+id/count"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#drawable/round_edittext"
android:focusable="false"
android:gravity="center"
android:inputType="number" >
</EditText>
<Button
android:id="#+id/plus"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#drawable/round_button"
android:text="+"
android:textSize="30sp"
android:textStyle="bold" />
</LinearLayout>
<Button
android:id="#+id/addtocart"
style="#style/button_text"
android:layout_width="wrap_content"
android:layout_height="45dp"
android:background="#drawable/cart_button_background"
android:padding="5dp"
android:text="Add to Cart"
android:textColor="#ffffff" />
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#color/list_divider" />
<TextView
android:id="#+id/description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="7dp"
android:text="Description"
android:textSize="20sp"
android:textStyle="bold" />
<View
android:layout_width="fill_parent"
android:layout_height="1.5dp"
android:background="#color/list_divider" />
<TextView
android:id="#+id/full_desc"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:padding="5dp"
android:paddingBottom="5dp"
android:textSize="15sp" />
</LinearLayout>
</ScrollView>
</SlidingDrawer>
</RelativeLayout>
</FrameLayout>

How to create a form that have autolookup in Android

I want to use auto look up for searching .
I have partially created this layout . This is my XML code.
Now how can i use autol lookup in this?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="#+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:src="#drawable/logo_demo" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageView1"
android:layout_marginTop="10dp"
android:background="#drawable/flight_bar"
android:orientation="horizontal" >
<TextView
android:id="#+id/roundtripTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="23dp"
android:layout_marginTop="5dp"
android:layout_weight="0.01"
android:text="Round trip"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/OneWayTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="23dp"
android:layout_marginTop="5dp"
android:layout_weight="0.01"
android:text="OneWay"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/multicityTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="23dp"
android:layout_marginTop="5dp"
android:layout_weight="0.03"
android:text="MultiCity"
android:textColor="#android:color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:id="#+id/linearLayout4"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout1"
android:background="#drawable/from2"
android:orientation="horizontal" >
<TextView
android:id="#+id/fromTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="7dp"
android:layout_weight=".05"
android:text="From" />
<TextView
android:id="#+id/toTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="7dp"
android:layout_weight=".05"
android:text="To" />
</LinearLayout>
</RelativeLayout>
i have to use a auto look up box same below to the to i have to use autolook up and in the middle of both there will be image .So i have done till from and to part now i am not able to create to separate auto look up box below from and to.
Try this layout.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:src="#drawable/ic_launcher" />
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#+id/imageView1"
android:layout_marginTop="10dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/roundtripTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#FF0000FF"
android:gravity="center"
android:text="Round trip"
android:textColor="#android:color/white"
android:textSize="20sp" />
<TextView
android:id="#+id/OneWayTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#FF0000FF"
android:gravity="center"
android:text="OneWay"
android:textColor="#android:color/white"
android:textSize="20sp" />
<TextView
android:id="#+id/multicityTextView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#FF0000FF"
android:gravity="center"
android:text="MultiCity"
android:textColor="#android:color/white"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout1"
android:orientation="horizontal" >
<LinearLayout
android:id="#+id/linearLayout4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical" >
<EditText
android:id="#+id/fromTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:gravity="center_horizontal"
android:hint="From" />
<TextView
android:id="#+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="LON"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="London Great Britain"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#android:color/darker_gray"
android:src="#drawable/ic_launcher" />
<LinearLayout
android:id="#+id/linearLayout5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical" >
<EditText
android:id="#+id/toTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:gravity="center_horizontal"
android:hint="To" />
<TextView
android:id="#+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="DXB"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Dubai United Arab Emirates"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Edit
Put below layout after "from/to" layout.
<LinearLayout
android:id="#+id/linearLayout4"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#+id/linear3"
android:orientation="horizontal" >
<AutoCompleteTextView
android:id="#+id/textView1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="bottom"
android:text="LON" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/darker_gray"
android:src="#drawable/ic_launcher" />
<AutoCompleteTextView
android:id="#+id/textView3"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="bottom"
android:text="DXB" />
</LinearLayout>

Header Layout Hidden When Scrolling With Soft Keyboard Shown

I have a strange error with ScrollView.
When the soft keyboard is not shown, scrolling works fine on both 2.2, 2.3 and 4.0.
But when the soft keyboard is shown, scrolling makes header layout invisible on 2.2 and 2.3.
What's wrong with my layout?
Please give me your suggestion.
This is my layout :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/white"
android:orientation="vertical" >
<include
android:id="#+id/header"
layout="#layout/b2u_header" />
<ScrollView
android:id="#+id/ScrollView02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="15dp"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="#string/msg_register"
android:textColor="#color/black_color" />
<include
android:id="#+id/friend_name_table"
layout="#layout/b2u_profile_friend_name_table" />
<include
android:id="#+id/other_info"
layout="#layout/b2u_profile_settings_other_info" />
<LinearLayout
android:id="#+id/layout_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:text="#string/password"
android:textColor="#000000" />
<EditText
android:id="#+id/edt_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:hint="パスワード"
android:inputType="textPassword" />
<EditText
android:id="#+id/edt_password_rewrite"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:hint="確認用パスワード"
android:inputType="textPassword" />
</LinearLayout>
<TextView
android:id="#+id/question_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:text="■パスワードを忘れた時のヒント"
android:textColor="#000000" />
<Spinner
android:id="#+id/spinner_reminder_questions"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:entries="#array/reminder_questions" >
</Spinner>
<TextView
android:id="#+id/answer_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:text="こたえ"
android:textColor="#000000" />
<EditText
android:id="#+id/answer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:gravity="center_vertical" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:text="■ メールマガジンを受け取る"
android:textColor="#000000" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RadioGroup
android:id="#+id/confirmemail_group"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/rb_notreceive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="受け取らない"
android:textColor="#000000" />
<RadioButton
android:id="#+id/rb_receive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="受け取る"
android:textColor="#000000" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:id="#+id/layout_agree_term"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:text="■ 利用規約、プライバシーポリシーの同意"
android:textColor="#000000" />
<TextView
android:id="#+id/term_btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:textColor="#000000" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal" >
<CheckBox
android:id="#+id/agree_term"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 同意する" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

Keypad overlapping EditText

i am using the below XML file in this XML file when i click on Edittext the keypad is overlapping the edit text
XML:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#drawable/blue_bg"
>
<!-- Menu Panel -->
<RelativeLayout
android:id="#+id/menuPanel"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:gravity="right"
android:background="#52555a"
android:orientation="vertical" >
<TextView
android:id="#+id/menu_title_1"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="0dp"
android:paddingLeft="15dp"
android:gravity="center_vertical"
android:background="#353535"
android:textColor="#android:color/white"
android:text="#string/menu_title">
</TextView>
<View
android:id="#+id/menu_item_divider_1"
android:layout_width="fill_parent"
android:layout_height="0.5dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_below="#+id/menu_title_1"
android:background="#b5b5b5"/>
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/menu_item_divider_1"
android:dividerHeight="1dp"
android:id="#+id/list"
></ListView>
</RelativeLayout>
<!-- Sliding Panel -->
<LinearLayout
android:id="#+id/slidingPanel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/background"
android:gravity="left"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="#drawable/file" >
<View
android:id="#+id/header_vertical_divider_1"
android:layout_width="2dp"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_toRightOf="#+id/menuViewButton"
android:background="#drawable/engraved_bg" />
<ImageView
android:id="#+id/menuViewButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:clickable="true"
android:contentDescription="#string/description"
android:onClick="slidewindow"
android:src="#drawable/icon_menu"
android:visibility="visible" />
<ImageView
android:id="#+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="#drawable/sislogo"
/>
</RelativeLayout>
<View
android:id="#+id/dividerHeaderBottom"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#414141" />
<ImageView
android:id="#+id/clientlogo"
android:layout_width="match_parent"
android:layout_height="50dp"
android:scaleType="fitXY" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/rounded_edittext"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:paddingBottom="15dp"
android:layout_marginTop="15dp"
android:layout_weight="25"
>
<EditText
android:id="#+id/newuser"
style="#style/edittxt1"
android:layout_below="#+id/olduser"
android:layout_centerHorizontal="true"
android:visibility="invisible"
>
<requestFocus />
</EditText>
<EditText
android:id="#+id/confirmuser"
style="#style/edittxt1"
android:layout_below="#+id/newuser"
android:layout_centerHorizontal="true"
android:visibility="invisible"
>
<requestFocus />
</EditText>
<Button
android:id="#+id/changedetails"
style="#style/btnstyle"
android:layout_below="#+id/confirmuser"
android:layout_centerHorizontal="true"
android:background="#drawable/button_sytle"
android:onClick="usernamepassword"
android:text="Enter"
android:visibility="visible"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:layout_marginTop="20dp"
/>
<Spinner
android:id="#+id/manageaccounts"
style="#style/spinnerstyle"
android:layout_below="#+id/imageView1"
/>
<EditText
android:id="#+id/olduser"
style="#style/edittxt1"
android:layout_below="#+id/manageaccounts"
android:layout_centerHorizontal="true"
android:visibility="invisible"
>
<requestFocus />
</EditText>
<ListView
android:id="#+id/linkedparents"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/manageaccounts"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:visibility="invisible"
>
</ListView>
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#drawable/containerheader"></ImageView>
<TextView
android:id="#+id/textView1"
style="#style/mainlbl"
android:layout_alignBottom="#+id/imageView1"
android:layout_alignLeft="#+id/manageaccounts"
android:text="Manage Account(s)"
android:layout_marginBottom="5dp"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="bottom">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="bottom"
android:background="#drawable/bottom_bar">
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginBottom="3dp"
android:layout_marginLeft="10dp"
android:src="#drawable/hom"
android:onClick="HOME"
/>
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/imageView3"
android:layout_marginRight="5dp"
android:layout_marginBottom="3dp"
android:src="#drawable/logout"
android:onClick="Logout"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
i am using the requesfocous for each edittext i want edittext to move up when i click on edittext box how can i achieve this.
Set this property for the activity in your manifest
android:windowSoftInputMode="stateVisible|adjustPan"
If works please share it

Basic Scolling Question

Hey guys, im pretty new to android platform and have a really simple question. Im putting buttons as layouts with text boxes, but im running out of room. How would i make it possible for the user to scroll down to view more buttons and stuff. For example, if i have 6 buttons, and 3 are in the field of view, i wanna be able to scroll with my finger and be able to see those buttons as I scroll.
Thanks for the help guys
-Localgamer
You can put your controls(widgets: buttons, labels etc) inside a ScrollView. Check the documentation of the class for details : http://developer.android.com/reference/android/widget/ScrollView.html
Something like:
<ScrollView ..>
<TextView .../>
<Button .../>
</ScrollView>
Try this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/proffrag"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#ffffff"
android:orientation="vertical" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="30dip"
android:paddingRight="30dip"
android:paddingTop="10dip" >
<EditText
android:id="#+id/firstname"
style="#style/custom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/rounded_edittext"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
android:drawableLeft="#drawable/usernamem"
android:drawablePadding="10dp"
android:ems="10"
android:hint="#string/firstname"
android:inputType="textCapWords"
android:singleLine="true" >
<requestFocus />
</EditText>
<View
android:layout_width="fill_parent"
android:layout_height="10dp" />
<EditText
android:id="#+id/lastname"
style="#style/custom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/rounded_edittext"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
android:drawableLeft="#drawable/usernamem"
android:drawablePadding="10dp"
android:ems="10"
android:hint="#string/lastname"
android:inputType="textCapWords"
android:singleLine="true" />
<View
android:layout_width="fill_parent"
android:layout_height="10dp" />
<EditText
android:id="#+id/username"
style="#style/custom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/rounded_edittext"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_#-."
android:drawableLeft="#drawable/usernamem"
android:drawablePadding="10dp"
android:ems="10"
android:hint="#string/username"
android:singleLine="true" />
<View
android:layout_width="fill_parent"
android:layout_height="10dp" />
<EditText
android:id="#+id/email"
style="#style/custom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/rounded_edittext"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_#-.,"
android:drawableLeft="#drawable/emailm"
android:drawablePadding="10dp"
android:ems="10"
android:hint="#string/email"
android:inputType="textEmailAddress"
android:singleLine="true" />
<View
android:layout_width="fill_parent"
android:layout_height="10dp" />
<TextView
android:id="#+id/selecttopic"
style="#style/custom"
android:layout_width="match_parent"
android:layout_height="20dp"
android:ems="10"
android:singleLine="true"
android:text="#string/selecttopic" />
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/radiosubject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/rbtn_selector"
android:button="#null"
android:gravity="center"
android:padding="5dp"
android:text="Subject"
android:textColor="#drawable/rbtn_textcolor_selector" />
<RadioButton
android:id="#+id/radiocourse"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/rbtn_selector"
android:button="#null"
android:gravity="center"
android:padding="5dp"
android:text="Courses"
android:textColor="#drawable/rbtn_textcolor_selector" />
</RadioGroup>
<View
android:layout_width="fill_parent"
android:layout_height="10dp" />
<TextView
android:id="#+id/selectgen"
style="#style/custom"
android:layout_width="match_parent"
android:layout_height="20dp"
android:ems="10"
android:singleLine="true"
android:text="#string/selectgen" />
<RadioGroup
android:id="#+id/radioGroup2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/radiomale"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/rbtn_selector"
android:button="#null"
android:gravity="center"
android:padding="5dp"
android:text="#string/selectmale"
android:textColor="#drawable/rbtn_textcolor_selector" />
<RadioButton
android:id="#+id/radiofemale"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/rbtn_selector"
android:button="#null"
android:gravity="center"
android:padding="5dp"
android:text="#string/selectfemale"
android:textColor="#drawable/rbtn_textcolor_selector" />
</RadioGroup>
<View
android:layout_width="fill_parent"
android:layout_height="10dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/proftextgender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true" />
<Button
android:id="#+id/browse"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#drawable/mycustom_button"
android:minHeight="40dp"
android:text="#string/browse"
android:textColor="#ffffff" />
</RelativeLayout>
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="10dp" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<LinearLayout
android:id="#+id/firs"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:orientation="horizontal"
android:paddingLeft="20dp" >
<TextView
android:id="#+id/browseimage"
android:layout_width="109dp"
android:layout_height="wrap_content"
android:layout_weight="1.17"
android:maxLines="2" />
</LinearLayout>
<View
android:id="#+id/vi"
android:layout_width="20dp"
android:layout_height="fill_parent"
android:layout_toRightOf="#id/firs" >
</View>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="#id/vi"
android:layout_weight="1"
android:orientation="horizontal" >
<Button
android:id="#+id/upload"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/mycustom_button"
android:minHeight="30dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/upload"
android:textColor="#ffffff" />
</LinearLayout>
</RelativeLayout>
<View
android:layout_width="fill_parent"
android:layout_height="5dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_horizontal"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingLeft="30dp"
android:paddingRight="30dp" >
<Button
android:id="#+id/savechagnes"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/mycustom_button"
android:minHeight="40dp"
android:text="#string/savechanges"
android:textColor="#ffffff" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="5dp" />
</LinearLayout>
</ScrollView>
</LinearLayout>

Categories

Resources