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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:43:04+00:00 2026-06-18T23:43:04+00:00

I have a 2-column list layout like this: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:paddingTop=4dip

  • 0

I have a 2-column list layout like this:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:paddingTop="4dip"
     android:paddingBottom="6dip"
     android:layout_marginLeft="10dp"     
     android:layout_width="fill_parent"

     android:layout_height="wrap_content"
     android:orientation="horizontal">

     <TextView android:id="@+id/TRAIN_CELL"
         android:layout_width="275dip"
         android:layout_height="wrap_content"
         android:textSize="16sp"/>

     <TextView android:id="@+id/TO_CELL"
         android:layout_width="25dip"
         android:textSize="20sp"
         android:textStyle="bold" 
         android:gravity="center"
         android:textColor="@color/light_best_blue"
         android:layout_height="wrap_content"  
         android:layout_weight="1"/>

</LinearLayout>

But the line: android:layout_marginLeft=”10dp” does not produce and effect of adding space. Also, the screen itself has a left margin but the list does not respond to that as well.

Is there a way to make sure there is spacing on the left side of the screen?

Thanks!

Here is the code:

private List<HashMap<String, String>> fillMaps;
private SimpleAdapter adapter;

ListView list = null;

    list = (ListView) findViewById(android.R.id.list);

    // My data
    fillMaps = new ArrayList<HashMap<String, String>>();

    adapter = new SimpleAdapter(this, fillMaps, R.layout.questions_list,
            new String[] {"train", "to"}, 
            new int[] {R.id.TRAIN_CELL,  R.id.TO_CELL});        
    //adapter = new ArrayAdapter<Question>(this, R.layout.user_question_list, questions);

    setListAdapter ( adapter );

    ListView lv = getListView();
    lv.setTextFilterEnabled(true);

and later I populate the list like this:

                            HashMap<String, String> map = new HashMap<String, String>();                                
                            JSONObject o = obj.getJSONObject(i);

                            String question_id = o.getString("question_id");
                            String question = o.getString("question");
                            String questioner_id = o.getString("member_id");
                            String first_name = o.getString("first_name");
                            String last_name = o.getString("last_name");

                            Question q = new Question ( );
                            q.setQuestion(question);
                            q.setQuestionId(question_id);
                            q.setQuestionByMemberId( questioner_id );

                            q.setAuthorName(first_name + " " + last_name );

                            map.put("train", question);

                            //map.put("from", ">");
                            map.put("to", ">");

                            fillMaps.add(map);
                            questions.add( q ); 
  • 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-18T23:43:05+00:00Added an answer on June 18, 2026 at 11:43 pm

    try change

     android:layout_marginLeft="10dp"     
    

    to

     android:layout_paddingLeft="10dp"     
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list like this: <html> <head> <link type=text/css rel=stylesheet href=testli.css> </head> <body>
I have a left sided menu like this: <table table-layout=fixed width=800px> <tr valign=top> <td
I have a database of webpages like this: import android.provider.BaseColumns; public interface ThreadDatabase extends
I have a column with a list of dates in a spreadsheet (.tsv) (some
I have a SQL Server 2000 database that will not display the column list
i have a list 1 column and 100 rows each with a number the
I have a list and a column; the column might have many values, and
In Django I have a SQL table with a column with a list of
i have checkbox list printed in one column, but i need it to print
I have a list view comprised of the following: // Add column headers for

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.