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 8639177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:56:10+00:00 2026-06-12T10:56:10+00:00

i have a list adapter for my list. the list item is created by

  • 0

i have a list adapter for my list. the list item is created by inflating a layout which has a relative layout with 50dp height. i want to change the height of the relative layout to be wrap content on orientation landscape and in portrait it be 50 dp. how can i achieve this?

  • 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-12T10:56:11+00:00Added an answer on June 12, 2026 at 10:56 am

    Create one folder in the res folder called layout-land for landscape mode. Inside that folder rewrite your xml file with height as wrap-content. In the xml of layout folder keep the height as 50 dp.

    Example: let say you have relative layout in abc.xml inside res\layout as given:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_height="50">"
         <!--Other code -->
    </RelativeLayout >
    

    Create abc.xml inside res\layou-land as given below:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_height="wrap_content">"
             <!--Other code -->
     </RelativeLayout >
    

    If you are in landscape or portrait Android looks for the layout file in either the -port or -land directory first, if it’s not found then it falls back to the default layout directory.

    You can read about providing alternative resources here. There are many more options than just land and port.

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

Sidebar

Related Questions

I want to use a list view and I have created my own layout
I have created the simple list view with base adapter.Now I want to add
I have List I want to sort Desc by Priority, which is int and
I have created a custom listview using adapter. Each row of the list view
I have created a list. Now when I click on the list item I
I have created a custom Cursor Adapter for my list.The list gets some data
I have created a custom Base Adapter class, to populate a list view with
I have list view and its adapter stored as global variables. I am not
I have a listview connected to a custom array adapter. This list shows information
I have a ListView set with a adapter. This adapter receive a list of

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.