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

  • SEARCH
  • Home
  • 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 7784461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:05:55+00:00 2026-06-01T20:05:55+00:00

In the camera app layout it has: camera.xml: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/app_root android:orientation=vertical android:layout_width=match_parent android:layout_height=match_parent>

  • 0

In the camera app layout it has:

camera.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/app_root"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
<include layout="@layout/preview_frame"/>
<include layout="@layout/camera_control"/>
</LinearLayout>

and preview_frame.xml is

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/frame_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="1">
    .....
</RelativeLayout> 

and camera_control.xml is:

<ControlPanelLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/control_panel"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="76dp"
    android:background="@drawable/bg_camera_pattern">
    .....
 </ControlPanelLayout>

My question is what is the ‘layout_weight=”1″ ‘ in preview_frame.xml for?
I have read about layout_weight but most of the time it used with layout_width=”0px”
And in camera_control, it does not have any layout_weight specified.

But in this case, it is not.

Thank you.

  • 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-01T20:05:56+00:00Added an answer on June 1, 2026 at 8:05 pm

    Layout weight decides how any remaining space in the parent is filled after all the added views have taken up their basic area.

    The weights of the views in a viewgroup are added up and the leftover space is divided proportionally. So two views with width 0 and weights 1 and 2 will sum to a weight of 3 and one view will expand to 1/3 of the view size and the other to 2/3.

    However if views have width, they will take up that space before handing out the extra space. So a view with a width and no weight will take up the allotted space and a weighted view beside it will fill the remainder, so in our previous example of weights 1 and 2 if the weight 1 view has a width, it will expand to additionally include 1/3 of the REMAINING space which could put it at being larger than the weight 2 view.

    A little unfocused, haven’t had me coffee,but I hope it helps you out 😛

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code: package com.commonsware.android.skeleton; import android.app.Activity; import android.content.Context; import android.hardware.Camera; import android.hardware.Camera.*;
My camera app has the ability to toggle on/off Night vision and thus NIR
The system's camera app has a UI effect. After taking a photo, it will
I have a simple camera app, that has a AVCaptureVideoPreviewLayer inside a View. I
The default camera app has a photo gallery which has glossy and transparent look,
My question is straight and simple. Open the camera app on any android device.
I am writing and Android app that uses the camera. Once activity saves and
I have camera preview on my android app but when I add an 'id'
I'm making an android 1.6 app that uses phone's camera. In order to do
In an android app I return from the android camera a bitmap which is

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.