Floating action button above scrollView - android

How can i position floating button above Scrollview layout...i have tried to position Scrollview and the container of the button(FrameLayout) inside Relative layout but this approach also is not working...
xml file:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="100">
<ScrollView
android:layout_width="match_parent"
android:layout_height="#dimen/no_size"
android:layout_weight="92">
<LinearLayout
android:id="#+id/questionContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.rey.material.widget.TextView
android:id="#+id/surveyTitleTtv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="12dp"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="#android:color/black" />
<com.rey.material.widget.TextView
android:id="#+id/test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:layout_marginLeft="12dp"
android:layout_marginBottom="12dp"
android:textColor="#color/accentColor"
android:textSize="17dp"
android:textStyle="bold" />
</LinearLayout>
</ScrollView>
<FrameLayout
android:id="#+id/bottomSheetLlt"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="8"
android:background="#android:color/white">
<com.rey.material.widget.FloatingActionButton
android:id="#+id/saveQuestionBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="-20dp"
android:text="ADD"
app:elevation="2dp" />
</FrameLayout>
Please can anyone tell me what's going wrong?

Finally i have managed to resolve the issue..the problem was that i was trying to place FAB inside fragment layout which obviously turned out to be not feasible. I moved it inside my activity xml layout as a child of CoordinatorLayout and now is actually a 'floating' action button...

Just move your FloatingButton above scroll view in xml layout

You need to position a FloatingActionButton within a CoordinatorLayout and use the CoordinatorLayout as the root of your Activity. (FloatingActionButton relies on features which the CoordinatorLayout enables) If your scrollview is a inside a fragment, this is still alright - so long as you assign an ID to the FloatingActionButton you can reference it from inside the fragment.

Replace your xml code with below code. You need to use Relative Layout or Coordinator Layout as root layout. And simply put floatig action button outside of framelayout.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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/questionContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.rey.material.widget.TextView
android:id="#+id/surveyTitleTtv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="12dp"
android:textColor="#android:color/black"
android:textSize="20sp"
android:textStyle="bold" />
<com.rey.material.widget.TextView
android:id="#+id/test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:textColor="#color/accentColor"
android:textSize="17dp"
android:textStyle="bold" />
</LinearLayout>
</ScrollView>
<com.rey.material.widget.FloatingActionButton
android:id="#+id/saveQuestionBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="bottom|right|end"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:text="ADD"
app:elevation="2dp" />

Related

Centering Nested Relative layout in parent

I have to make (sort of) footer for empty screen. My parent layout is RelativeLayout1. Inside this layout I have ToolBar and below that is another RelativeLayout2.
Inside this RelativeLayout2 is Button and another RelativeLayout3. I made it that way, because I want to center RelativeLayout3 content in RelativeLayout2 and Button should always align bottom of the parent layout(RelativeLayout2)
I got answer for similar question before, but it doesnt always work. My problem now is that RelativeLayout3 is off-centered vertically(it's closer to the bottom).
How it should looks like
How it actually looks like
How to fix this?
Full Layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#color/colorBackground"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="#+id/toolBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/toolbar_round"
android:orientation="horizontal">
<include
android:id="#+id/toolBarContent"
layout="#layout/order_toolbar_layout" />
</android.support.v7.widget.Toolbar>
<RelativeLayout
android:id="#+id/order_complete_footer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/toolBar"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/order_complete_image_text_layout"
android:layout_centerInParent="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:id="#+id/order_complete_image"
android:layout_width="175dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:src="#drawable/footer_image" />
<TextView
android:id="#+id/order_complete_text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/order_complete_image"
android:layout_marginEnd="50dp"
android:layout_marginStart="50dp"
android:layout_marginTop="-12dp"
android:gravity="center_horizontal"
android:text="#string/order_complete_screen_text1"
android:textColor="#color/colorItemMinor"
android:textStyle="bold"
android:textSize="12sp" />
<TextView
android:id="#+id/order_complete_text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/order_complete_text1"
android:layout_marginEnd="50dp"
android:layout_marginStart="50dp"
android:gravity="center_horizontal"
android:text="#string/order_complete_screen_text2"
android:textColor="#color/colorItemMinor"
android:textSize="12sp" />
</RelativeLayout>
<Button
android:id="#+id/order_complete_continue_button"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="#dimen/address_creation_button_padding_TOP_BOTTOM"
android:layout_marginEnd="#dimen/address_creation_button_padding_START_END"
android:layout_marginStart="#dimen/address_creation_button_padding_START_END"
android:layout_marginTop="#dimen/address_creation_button_padding_TOP_BOTTOM"
android:background="#drawable/login_button_background_void"
android:text="#string/order_complete_screen_button_label"
android:textAppearance="#style/VoidLoginButtonTextAppearance" />
</RelativeLayout>
</RelativeLayout>
If I understood correctly, you should add the following to your order_complete_image_text_layout.
android:layout_above="#id/order_complete_continue_button"
#JanStoltman

how do I place relativelayout under another relativelayout using xml

I am trying to place a relativelayout under another (with recyclerview in it) within an activity layout container.
What I'd like to get is to have the action bar, then below a relativelayout with header (showing a spacer and 2 textviews), and below again another relativelayout that will host cards from a recyclerview.
This is the image of the wanted design:
What I get instead is this:
I am using the following xml (but tried many others)
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="#style/Theme.AppCompat.Light">
<RelativeLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
tools:ignore="UselessParent">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:contentDescription="image"
android:scaleType="centerCrop"
android:src="#drawable/category_detail_1" />
<TextView
android:id="#+id/spacer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text=""
android:textColor="#fff"
android:textSize="25sp" />
<TextView
android:id="#+id/sub_header_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/spacer"
android:background="#66555555"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text=""
android:textColor="#fff"
android:textSize="30sp"
android:textStyle="bold" />
<TextView
android:id="#+id/sub_header_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/sub_header_title"
android:background="#66555555"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text=""
android:textColor="#fff"
android:textSize="20sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/button_container"
android:layout_width="395dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/header"
tools:ignore="UselessParent">
<android.support.v4.widget.Space
android:layout_width="#dimen/default_spacing_small"
android:layout_height="#dimen/default_spacing_small" />
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
I tried to put the second RelativeLayout nested as a child of the first one with no luck.
The Android Studio preview shows the design well formatted but after build the card list overlaps the header. Well formatted apart from the unknown line/constraint I do not know how to remove. It constraints the second relativelayout to the top.
What am I missing?
Any help is appreciated.
Use FrameLayout instead of android.support.constraint.ConstraintLayout
Or try with LinearLayout

How to keep a View on top of my Fragments

Sounds like a question that was answered before but from my research I couldn't find a solution. My layout is roughly the following:
The main area is a container where I'll add/replace Fragments, and the bottom is where I place a bottom navigation menu. The pink View is a button that I need to place on top of my menu (and that's not working).
Every time I add a Fragment to the main view, my "Menu" text disappears, even though the TextView is added after the container View. Same with the pink Button, which is added after the bottom menu container (see my xml below).
How can I keep both "Menu" TextView and the pink Button always on top of my Fragments?
This is my xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eee"
tools:context="com.wecancer.wecancer.activities.Menu">
<FrameLayout
android:id="#+id/main_container_view"
android:layout_width="match_parent"
android:layout_height="520dp"
android:layout_marginBottom="0dp"
>
</FrameLayout>
<TextView
android:id="#+id/main_center_tv"
android:layout_centerVertical="true"
android:textSize="24sp"
android:layout_centerHorizontal="true"
android:text="#string/menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_alignParentBottom="true"
android:id="#+id/main_bottom_menu_container"
android:layout_width="match_parent"
android:background="#color/lightGray"
android:layout_height="40dp"
>
</FrameLayout>
<Button
android:elevation="1dp"
android:id="#+id/menu_plus_img"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:background="#color/colorAccent"
android:layout_width="70dp"
android:layout_marginBottom="0dp"
android:layout_height="70dp"
tools:targetApi="lollipop" />
</RelativeLayout>
Try This`
<FrameLayout
android:layout_alignParentBottom="true"
android:id="#+id/main_bottom_menu_container"
android:layout_width="match_parent"
android:background="#color/colorPrimary"
android:layout_height="40dp"
>
</FrameLayout>
<Button
android:elevation="1dp"
android:id="#+id/menu_plus_img"
android:background="#color/colorAccent"
android:layout_width="70dp"
android:layout_height="70dp"
tools:targetApi="lollipop"
android:layout_marginLeft="71dp"
android:layout_marginStart="71dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="#+id/main_center_tv"
android:textSize="24sp"
android:text="#string/menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_alignBaseline="#+id/menu_plus_img"
android:layout_alignBottom="#+id/menu_plus_img"
android:layout_toRightOf="#+id/menu_plus_img"
android:layout_toEndOf="#+id/menu_plus_img" />
<FrameLayout
android:id="#+id/main_container_view"
android:layout_width="match_parent"
android:layout_height="520dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/menu_plus_img">
</FrameLayout>
`
You just have to change the order of the views in the layout while using a Framelayout
The complexity of your layout does not require a RelativeLayout so you just have to switch.
I don't really know why methods like bringToFront, bringChildToFront, or adding and removing View's children to change their indices didn't work. So I actually had to create a new layout structure.
Instead of:
RelativeLayout
...FrameLayout
...TextView
...FrameLayout
...Button
I did:
FrameLayout
...RelativeLayout
......FrameLayout
......FrameLayout
......TextView
...RelativeLayout
......Button
Whereas the second RelativeLayout has only a button and a transparent background. My full xml code is below as a reference.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/main_root_view"
android:layout_height="match_parent">
<RelativeLayout
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eee"
tools:context="com.wecancer.wecancer.activities.Menu">
<FrameLayout
android:layout_alignParentBottom="true"
android:id="#+id/main_bottom_menu_container"
android:layout_width="match_parent"
android:background="#color/lightGray"
android:layout_height="wrap_content" />
<FrameLayout
android:id="#+id/main_container_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="0dp" />
<TextView
android:id="#+id/main_center_tv"
android:layout_centerVertical="true"
android:textSize="24sp"
android:layout_centerHorizontal="true"
android:text="#string/menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:onClick="menuPlusBt"
android:elevation="5dp"
android:id="#+id/menu_plus_img"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:background="#drawable/green_circle"
android:layout_width="70dp"
android:layout_marginBottom="0dp"
android:layout_height="70dp"
tools:targetApi="lollipop" />
</RelativeLayout>
</FrameLayout>

ScrollView doesn't scroll to the bottom

I have a certain problem in my Activity. The ScrollView doesn't scroll down to the bottom.
I have a screenshot for you.
If you look at the scrollbar of the scrollView, you can see that it's not scrolling down to the bottom.
Here's my XML layout of the scrollView:
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:fillViewport="true"
android:layout_below="#+id/step2_header" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp" >
<TextView
android:id="#+id/step2_headerText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:gravity="center"
android:text="#string/Schritt2"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/dark_blue"
android:textStyle="bold|italic" />
<ImageView
android:id="#+id/step2_image"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_below="#+id/step2_headerText"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"
android:src="#drawable/menu_leiste" />
<TextView
android:id="#+id/step2_infoText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_alignParentLeft="true"
android:layout_below="#+id/step2_image"
android:text="#string/step2Text"
android:textAppearance="?android:attr/textAppearanceSmall" />
<ImageView
android:id="#+id/step2_but1Img"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_below="#+id/step2_infoText"
android:layout_marginTop="10dp"
android:src="#drawable/menu_leiste_selector" />
<TextView
android:id="#+id/step2_but1Text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/step2_but1Img"
android:layout_alignParentLeft="true"
android:layout_alignTop="#+id/step2_but1Img"
android:layout_marginLeft="10dp"
android:gravity="center"
android:text="#string/step2But1Text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<ImageView
android:id="#+id/step2_but1ArrowImg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:layout_alignBottom="#+id/step2_but1Img"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/step2_but1Img"
android:src="#drawable/location_web_site" />
<ImageView
android:id="#+id/step2_but2Img"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_below="#+id/step2_but1Img"
android:layout_marginTop="10dp"
android:src="#drawable/menu_leiste_selector" />
<TextView
android:id="#+id/step2_but2Text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/step2_but2Img"
android:layout_alignParentLeft="true"
android:layout_alignTop="#+id/step2_but2Img"
android:layout_marginLeft="10dp"
android:gravity="center"
android:text="#string/step2But2Text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/white" />
<ImageView
android:id="#+id/step2_but2ArrowImg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:layout_alignBottom="#+id/step2_but2Img"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/step2_but2Img"
android:src="#drawable/location_web_site" />
</RelativeLayout>
</ScrollView>
How can I fix it?
The problem is android:layout_margin="10dp" in RelativeLayout of SrcollView
Replace
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp">
with
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp" >
use in scrollView xml
android:paddingBottom="10dp"
it'll shift content of scroll view to 10 dp upward not the VIEW.
Try NestedScrollView instead.
I have had this problem several times myself and while simply adding extra padding to the bottom to hide the fact that the scroll view is going 'behind' the bottom bar works, a better solution is to use a NestedScrollView as mentioned in this answer: https://stackoverflow.com/a/36871385/6573127
For me I have another specific solution if the parent layout of the ScrollView is ConstraintLayout. If so, we don't need to set the padding or margin.
<androidx.constraintlayout.widget.ConstraintLayout
....>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="<if there is any element before this this scrollview >">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
For me, setting explicit height to some of my internal elements helped.
I was suffering from the same problem. Try to add more padding to the bottom of scrollView.It works for me.
android:paddingBottom="50dp"
This may be problem with your layout design. if you add the margin for the view then it will be visible clearly. so
In scrollview add
android:layout_marginBottom="30dp"

Button on the left of a frame layout?

In a vertical linear layout, I have 2 textviews, then a button and then a frame layout.
I would like the button to be on the left of the frame layout. I tried putting the button in a relative layout, but how do I tell the frame layout to be on the right?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/content_container_white"
android:orientation="vertical" >
<TextView
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="30dp"
android:text="#string/t0"
android:textColor="#color/black"
android:textSize="30dp" />
<TextView
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/t1"
android:textColor="#color/black" />
<RelativeLayout
android:id="#+id/RelativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="#+id/buybtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="30dp"
android:text="#string/buy_button" />
</RelativeLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|right"
android:layout_marginTop="10dp" >
<ImageButton
android:id="#+id/videothumb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:src="#drawable/button_play_on" />
<ImageView
android:id="#+id/videothumbimage"
android:layout_width="380dp"
android:layout_height="170dp"
android:scaleType="centerCrop"
android:src="#drawable/demo_thumb_home" />
</FrameLayout>
</LinearLayout>
You can do it by simply telling your FrameLayout android:layout_toRightOf="#+id/#+id/buybtn", but your FrameLayout must be inside a RelativeLayout too.
<RelativeLayout
android:id="#+id/RelativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="#+id/buybtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="30dp"
android:text="#string/buy_button" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|right"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/#+id/buybtn" >
<ImageButton
android:id="#+id/videothumb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:src="#drawable/button_play_on" />
<ImageView
android:id="#+id/videothumbimage"
android:layout_width="380dp"
android:layout_height="170dp"
android:scaleType="centerCrop"
android:src="#drawable/demo_thumb_home" />
</FrameLayout>
</RelativeLayout>
Push FrameLayout into RelativeLayout or just put button and frame together in horizontal LinearLayout - what would be more simple
ps - kepp your code clean, use ctrl+shift+F (if using Eclipse) to auto-arrange it
Put your framelayout within Relativelayout and then set property align parent right.
The question makes no sense. From the documentation:
FrameLayout is designed to block out an area on the screen to display a single item.
Emphesis mine.
If you want your layout to contain more than one item, do not use a frame layout. Use something else.
Shachar

Categories

Resources