Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8203609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:37:02+00:00 2026-06-07T07:37:02+00:00

In a vertical linear layout, I have 2 textviews, then a button and then

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:37:03+00:00Added an answer on June 7, 2026 at 7:37 am

    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>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two cases with Linear (also tried Relative) layout in android. The one
i have a problem with the linear layout of android. i have something like
I have a simple vertical LinearLayout in which there is a button on the
I have a (vertical) UISlider inside a UIScrollview. I'd like to be able to
I have a vertical StackPanel with two elements: a Button and a ListBox. How
I have a scroll view that I would like to fill the whole screen,
Right I have a main layout defined, that has a frame, a table in
I have a ListView with some custom layout for the row (an image, then
Hi friends i have set my layout thru TabLayout within LinearLayout but still my
the vertical iPhone viewport width is 320 px, but what is the width in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.