I'm trying to implement a simple activity where the user can rate something and put a comment.
My view is this :
with the code :
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:background="#color/background_material_light"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:isScrollContainer="true"
>
<ImageView
android:id="#+id/img_journey"
android:layout_width="wrap_content"
android:layout_height="250dp"
android:src="#drawable/pirate"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_alignParentTop="true" />
<LinearLayout
android:id="#+id/ratingLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="#+id/img_journey"
android:layout_marginTop="10dp">
<TextView
android:id="#+id/title_journey"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title"
android:layout_gravity="center"
android:textSize="30sp"
android:textColor="#color/niceblue" />
<RatingBar
android:id="#+id/framework_normal_ratingbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:maxHeight="48dp"
android:rating="5"
android:layout_gravity="center"
android:layout_marginTop="10dp"/>
</LinearLayout>
<LinearLayout
android:id="#+id/textbox_rate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/button_layout"
android:layout_below="#+id/ratingLayout"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp">
<EditText
android:padding="10dp"
android:gravity="start"
android:background="#drawable/textbox"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="#string/hint_comment"
android:inputType="text"
android:autofillHints="" />
</LinearLayout>
<LinearLayout
android:id="#+id/button_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignParentBottom="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center|bottom"
android:orientation="horizontal"
android:weightSum="8"
android:layout_marginBottom="40dp">
<Button
android:id="#+id/btn_launch"
android:text="SEND RATE"
style="#style/button_classic"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</ScrollView>
The fact is, when I show the keyboard on clicking in the editText, the view is not scrollable and the result is this :
I search like 3 hours on the internet but I found nothing, the only result that I found was to put this on the onCreate of my activity
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN|WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN|WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
But it doesn't work either. (I've tried with and without each flag)
The second thing I've tried was to put the ScrollView into the RelativeLayout, but sameresult, doesn't work.
The thing I would like is that the keyboard appears below the edit text and that we do not see the button SEND RATE (except if the user scroll) and, finally, the user should be able to scroll even when the keyboard is displayed.
Am I doing something wrong or what ?
Thanks in advance !!
Related
I am designing a layout for an activity where some contents like Textview, spinner and buttons are arranged in the upper part of the screen. I want to position image view to the bottom of the screen with a match_parent attribute to fill to the remaining bottom of the screen and it has become a challenge to me as the image view is filling to the bottom of the remaining part of the screen. This is the entire layout of the upper section/part of the screen
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ScrollView
android:layout_width="fill_parent"
android:background="#drawable/xxxVal"
android:padding="10dp"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:id="#+id/dataVaues"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="25sp"
android:gravity="center_horizontal"
android:textColor="#000"
/>
<Spinner
android:id="#+id/spinBundle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6sp"
android:textColor="#000"
android:prompt="#string/_prompt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="#000"
android:text="Plan" />
<TextView
android:id="#+id/bundle"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textSize="30sp"
android:textColor="#000"/>
<!-- android:inputType="phone" -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="#000"
android:text="PValue:" />
<TextView
android:id="#+id/value"
android:inputType="value"
android:layout_height="wrap_content"
android:textSize="30sp"
android:layout_width="match_parent"
android:textColor="#000"/>
<TextView
android:id="#+id/validValue"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Valid:"
android:textColor="#000000" />
<TextView
android:id="#+id/valid"
android:inputType="valid"
android:layout_height="wrap_content"
android:textSize="30sp"
android:layout_width="match_parent"
android:layout_marginBottom="10dp"
android:textColor="#ff0000"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical" >
<Button
android:id="#+id/proceed"
android:text="Proceed"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:textColor="#000"/>
<Button
android:id="#+id/data"
android:text="Check"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_marginTop="10dp"
android:textColor="#000"/>
</LinearLayout>
this is remaining part of the layout with a view flipper for an image that I want it to fit down to the remaining part of the screen but its not fitting as it shrinks up
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="3dp"
android:gravity="center_horizontal"
android:orientation="vertical" >
<ViewFlipper
android:id="#+id/flipper1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:flipInterval="5000"
android:inAnimation="#anim/slide_in_right"
android:outAnimation="#anim/slide_out_left" >
</ViewFlipper>
</LinearLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
please kindly assist!
Try adding the imageview to the Viewflipper like so:
<ViewFlipper
android:id="#+id/simpleViewFlipper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src=IMAGE />
</ ViewFlipper >
Having said that you might find some issues regarding swiping when using a viewflipper inside a scrollview
I have a problem that i want to show the linear layout in parent after i check the condition. I want to show linear layout android:id="#+id/linearIndex" in the body of parent layout. Here the code.
The Layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:id="#+id/lstep3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
android:id="#+id/linearIndex"> //THE LAYOUT I WANT TO SHOW
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textStyle="bold"
android:text="Jumlah Kasus Tambahan di Lokasi PE"
android:textColor="#color/teal"
/>
<!-- daftar gejala yang dimasukkan-->
<ListView
android:layout_width="match_parent"
android:layout_height="120dp"
android:id="#+id/listvievadvance2"
android:layout_marginTop="10dp"></ListView>
<!-- form gejala-->
<!-- form data gejala-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="15dp"
android:background="#color/accent_501">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Pilih Lokasi"
android:textStyle="bold"/>
<Spinner
android:id="#+id/lokasiPilih"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
/>
<TextView
android:id="#+id/txtLocLain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Lokasi lain"
android:textStyle="bold"
/>
<EditText
android:layout_width="match_parent"
android:layout_marginTop="7dp"
android:hint="Lokasi lain"
android:layout_height="wrap_content"
android:id="#+id/lokasiLain"
android:theme="#style/TextLabel"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Tanggal PE"
android:textStyle="bold"
/>
<EditText
android:layout_width="match_parent"
android:layout_marginTop="7dp"
android:hint="Tanggal PE"
android:layout_height="wrap_content"
android:id="#+id/tglPE"
android:editable="false"
android:theme="#style/TextLabel"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Jumlah Kasus tambahan"
android:textStyle="bold"
/>
<EditText
android:layout_width="match_parent"
android:layout_marginTop="7dp"
android:hint="Masukan jumlah kasus"
android:layout_height="wrap_content"
android:id="#+id/jmlKasusTambah"
android:theme="#style/TextLabel"
/>
<Button
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="#+id/btambahLokasi"
android:text="Tambah"
android:textColor="#fff"
android:layout_marginTop="10dp"
android:background="#color/teal"
/>
</LinearLayout>
</LinearLayout>
And the java file
Function that show visibility of layout
private void checkIndexOrNot(){
Log.i("Value :", String.valueOf(campak.getSurveilans().getStatusKasus()));
if(Integer.parseInt(campak.getSurveilans().getStatusKasus()) == 1) {
linearIndex.setVisibility(View.VISIBLE);
} else {
linearIndex.setVisibility(View.GONE);
}
}
I know it's look like no problem, but the function that show visibility of layout does not work. The layout does not show after check condition. The logic of the condition that check from DB is working fine, no error.
I put the checkIndexOrNot() in onCreate() function.
Thank you in advance.
Your parent layout of linearIndex has gone as default property mean it will not be visible. To show children views, the parent layout must be visible. So either set both layouts to visible programatically or just remove the visibility="gone" from lstep3
Just remove android:visibility="gone" from root layout.
Change this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:id="#+id/lstep3">
To this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/lstep3">
How to add Floating Action Button from the support library for CardView so that when you scroll through the ScrollView, the button has gone up along with the card?
My app
before scrolling
after scrolling
The button should go along with the card
I want to fix this
Layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
>
<ScrollView
android:id="#+id/nested_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/white_vk_background_color">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/spacing_8"
android:orientation="vertical"
android:padding="#dimen/spacing_16">
<android.support.v7.widget.CardView
android:id="#+id/behavior_card_view"
style="#style/RateCardView"
app:cardBackgroundColor="#color/white"
app:cardCornerRadius="#dimen/spacing_2"
app:cardElevation="#dimen/spacing_8">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="#dimen/spacing_16"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="#dimen/spacing_8">
<TextView
android:id="#+id/description_rate_usd_text_view"
style="#style/AppTextView.RateTextView"
android:text="#string/description_currency_text_view_usd"/>
<TextView
android:id="#+id/rate_usd_text_view"
style="#style/AppTextView.RateTextView"
android:layout_centerHorizontal="true"
android:layout_toRightOf="#id/description_rate_usd_text_view"
tools:text="63.99"
/>
<TextView
android:id="#+id/rate_difference_usd_text_view"
style="#style/AppTextView.DifferenceTextView"
android:layout_toRightOf="#id/rate_usd_text_view"
tools:text="+0.44"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="#dimen/spacing_8">
<TextView
android:id="#+id/description_rate_eur_text_view"
style="#style/AppTextView.RateTextView"
android:text="#string/description_currency_text_view_eur"/>
<TextView
android:id="#+id/rate_eur_text_view"
style="#style/AppTextView.RateTextView"
android:layout_centerHorizontal="true"
android:layout_toRightOf="#id/description_rate_eur_text_view"
tools:text="71.99"
/>
<TextView
android:id="#+id/rate_difference_eur_text_view"
style="#style/AppTextView.DifferenceTextView"
android:layout_toRightOf="#id/rate_eur_text_view"
tools:text="+0.15"/>
</RelativeLayout>
<TextView
android:id="#+id/rate_update_time_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
android:layout_marginBottom="#dimen/spacing_8"
android:layout_marginLeft="#dimen/spacing_16"
android:layout_marginTop="#dimen/spacing_16"
android:gravity="center"
android:textSize="#dimen/density_font_size_text_date"
tools:text="Date: 15.07.2016"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/converter_card_view"
style="#style/RateCardView"
app:cardBackgroundColor="#color/white"
app:cardCornerRadius="#dimen/spacing_2"
app:cardElevation="#dimen/spacing_8">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="#dimen/spacing_16">
<com.rengwuxian.materialedittext.MaterialEditText
android:id="#+id/converter_ruble_edit_text"
style="#style/RateEditText"
android:hint="#string/description_currency_ruble"
app:met_baseColor="#android:color/black"
app:met_bottomTextSize="#dimen/density_font_size_text_converter"
app:met_errorColor="#color/red_light"
app:met_floatingLabel="normal"
app:met_floatingLabelAlwaysShown="true"
app:met_floatingLabelTextSize="#dimen/density_font_size_text_converter"
app:met_helperText=""
app:met_primaryColor="#color/red_light"
app:met_textColorHint="#android:color/transparent"/>
<com.rengwuxian.materialedittext.MaterialEditText
android:id="#+id/converter_dollar_edit_text"
style="#style/RateEditText"
android:hint="#string/description_currency_dollar"
app:met_baseColor="#android:color/black"
app:met_bottomTextSize="#dimen/density_font_size_text_converter"
app:met_errorColor="#color/red_light"
app:met_floatingLabel="normal"
app:met_floatingLabelAlwaysShown="true"
app:met_floatingLabelTextSize="#dimen/density_font_size_text_converter"
app:met_helperText=""
app:met_primaryColor="#color/red_light"
app:met_textColorHint="#android:color/transparent"/>
<com.rengwuxian.materialedittext.MaterialEditText
android:id="#+id/converter_euro_edit_text"
style="#style/RateEditText"
android:hint="#string/description_currency_euro"
app:met_baseColor="#android:color/black"
app:met_bottomTextSize="#dimen/density_font_size_text_converter"
app:met_errorColor="#color/red_light"
app:met_floatingLabel="normal"
app:met_floatingLabelAlwaysShown="true"
app:met_floatingLabelTextSize="#dimen/density_font_size_text_converter"
app:met_helperText=""
app:met_primaryColor="#color/red_light"
app:met_textColorHint="#android:color/transparent"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/update_floating_action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/density_spacing_size_floating_action_button"
android:layout_marginRight="#dimen/float_action_button_spacing_8"
android:src="#drawable/ic_cached_white_24dp"
app:fabSize="mini"
app:layout_anchor="#id/behavior_card_view"
app:pressedTranslationZ="6dp"
app:layout_anchorGravity="end|right|center"
/>
</android.support.design.widget.CoordinatorLayout>
Instead of anchoring to behavior_card_view, try anchoring it to something inside behavior_card_view. Ideally, anchor to the bottom of the USD textview. This should prevent the FAB from sliding down.
I would actually create a invisible layout which I can use to anchor but it doesn't affect the UI otherwise.
I can't replicate the issue you are having but the following works as you want:
<RelativeLayout
android:id="#+id/rl1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingRight="10dp">
<TextView
android:id="#+id/tv1"
android:layout_width="match_parent"
android:layout_height="100dp"
android:paddingLeft="12dp"
android:text="Setting"
android:focusable="true"
android:focusableInTouchMode="true" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:src="#drawable/ic_add"
app:fabSize="mini"
app:pressedTranslationZ="6dp"
app:layout_anchorGravity="end|right|center"
app:layout_anchor="#id/tv1" />
... a lot of elements here ...
</RelativeLayout>
This RelativeLayout is the only element inside my ScrollView element.
Im having some layout issues, what I want to happen
1. My discussions_edit_text_wrap should be at the bottom of the view, when keyboard slides up it must be visible above the keyboard
2. The discussions_list_view should be just above the discussions_edit_text_wrap, also when keyboard slides up this should scroll to enable the user to view content. When the keyboard is closed this listview should not occupy the whole screen even if it has alot of items.
What happens
1. As the code is currently the list view shows but occupies the whole screen and runs underneath the edit text which sits at the top of the screen.
Help would be much appreciated, Thanks!
Here is the code:
<RelativeLayout
android:id="#+id/create_discussions_layout"
android:background="?attr/drawer_background"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:visibility="gone"
android:padding="10dp">
<!-- list of discussions -->
<LinearLayout
android:id="#+id/discussions_list_wrap"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<ListView
android:id="#+id/discussions_list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#color/divider_light"
android:dividerHeight="1dp"/>
<TextView
android:id="#+id/discussions_empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?text_small"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="30dp"
android:paddingRight="10dp"
android:text="#string/no_notes_available"
android:layout_gravity="left|center_vertical"
android:visibility="gone"/>
<View
android:layout_height="1dp"
android:layout_width="match_parent"
android:background="?divider_light"
android:layout_marginBottom="10dp"/>
</LinearLayout>
<!-- edittext areas for discussions content -->
<LinearLayout
android:id="#+id/discussions_edit_text_wrap"
android:layout_height="50dp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:weightSum="10">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="8"
android:layout_marginTop="8dp"
android:gravity="left">
<EditText
android:id="#+id/discussions_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/text_color_light"
android:imeOptions="actionNext"
android:hint="#string/add_new_comment"
android:focusable="true"
android:layout_marginRight="20dp"
android:focusableInTouchMode="true"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="right"
android:minWidth="200dp">
<Button
android:id="#+id/discussions_comment_button"
style="?main_button"
android:text="#string/comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Update
After adding android:layout_above="#+id/discussions_edit_text_wrap" and android:layout_alignParentBottom="true"
I tried adding a scroll view around everything on an activity layout but it gave me an error saying it can only be placed around one thing.
My activity, has a title textview then an image, then a description text view, and you can not read the whole description because its to long and goes below the edge of my screen. How can I make the whoel thing scrollable?
My xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/beerTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="40sp"
android:textStyle = "bold"
>
</TextView>
<ImageView android:id="#+id/image"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_margin="10dip"/>
<Button
android:id="#+id/buttonBrewery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<Button
android:id="#+id/buttonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="#+id/beerDEscriptionTitle"
android:textStyle = "bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="20sp"
android:text="Description"
></TextView>
<TextView
android:id="#+id/beerDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="15sp"
></TextView>
</LinearLayout>
Try this:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- TextView and other stuff -->
</LinearLayout>
</ScrollView>
Wrap the LinearLayout (height is wrap_content) with SrollView (height is fill_parent).
The "one thing" is your LinearLayout. Just wrap that in a ScrollView and you will encapsulate the layout for the entire activity.
Additionally, if you want to wrap just one elemtnet in a ScrollView all you have to do is put that element in it's own layout, like a linear or relative layout, and then that becomes the one element of your ScrollView
just use this
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollview"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/beerTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="40sp"
android:textStyle = "bold"
>
</TextView>
<ImageView android:id="#+id/image"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_margin="10dip"/>
<Button
android:id="#+id/buttonBrewery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<Button
android:id="#+id/buttonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="#+id/beerDEscriptionTitle"
android:textStyle = "bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="20sp"
android:text="Description"
></TextView>
<TextView
android:id="#+id/beerDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="15sp"
></TextView>
</LinearLayout>
</ScrollView>