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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:51:04+00:00 2026-05-28T00:51:04+00:00

I have a list view that looks like this and that’s its code ..

  • 0

I have a list view that looks like this

listview

and that’s its code ..

package com.a.c;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

public class calender extends ListActivity {
   /** Called when the activity is first created. */
   @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
            setListAdapter(new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1, calendr));
    getListView().setTextFilterEnabled(true);

}

static final String[] calendr = new String[]{
    "MONT Blanc",
    "Gucci",
    "Parker",
    "Sailor",
    "Porsche Design",
    "Rotring",
    "Sheaffer",
    "Waterman"
};}

i want to modify it to add this layout ,, and shift the listview downward little bit

the image looks like a picture frame that’s why i want to move the list view ..

Layout code at .XML file

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/relativeLayout1"
 android:layout_width="600px"
 android:layout_height="1024px"
 xmlns:android="http://schemas.android.com/apk/res/android">


<ImageView android:id="@+id/layout" 
            android:src="@drawable/layout" 
            android:layout_width="wrap_content" 
            android:layout_height="fill_parent"
           android:layout_alignParentBottom="true" 
           android:layout_alignParentLeft="true" 
           android:layout_alignParentRight="true" 
          android:layout_alignParentTop="true"></ImageView>

       </RelativeLayout>
  • 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-05-28T00:51:04+00:00Added an answer on May 28, 2026 at 12:51 am

    Hi You can use this code and achieve your target:

       main.xml
        <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    
        <ImageView
            android:id="@+id/layout"
            android:src="@drawable/icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"></ImageView>
        <ListView
            android:layout_width="match_parent"
            android:id="@+id/listViewScore"
            android:cacheColorHint="#00000000"
            android:layout_height="match_parent"
            android:layout_weight="1.00"
            android:divider="#C0C0C0"
            android:layout_below="@+id/layout"
            android:dividerHeight="2dip" />
    
    </RelativeLayout>
    
    
      listviewtext.xml
    
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <TextView
            android:text="Name"
            android:id="@+id/textViewName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusable="false"
            android:focusableInTouchMode="false"></TextView>
    
    
    </LinearLayout>
    
    
        public class TestProjeectActivity extends Activity {
    
            private ListView listViewScore = null;
            private ListViewAdapter listViewAdapter = null;
            private String[] usernameArr = null;
    
            /** Called when the activity is first created. */
            @Override
            public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
    
                listViewScore=(ListView)findViewById(R.id.listViewScore);
    
                usernameArr = new String[]{"Alan","Bob","Carl","Doaniel","Evan","Fred","Gram","Ian","Jordan"};
    
                listViewAdapter = new ListViewAdapter();
                listViewScore.setAdapter(listViewAdapter);
            }
    
            class ListViewAdapter extends BaseAdapter{
    
                @Override
                public int getCount() {
                    // TODO Auto-generated method stub
                    if(usernameArr==null){
                        return 0;
                    }
    
                    return usernameArr.length;
                }
    
                @Override
                public Object getItem(int position) {
                    // TODO Auto-generated method stub
                    return usernameArr[position];
                }
    
                @Override
                public long getItemId(int position) {
                    // TODO Auto-generated method stub
                    return position;
                }
    
                @Override
                public View getView(int position, View view, ViewGroup parent) {
                    // TODO Auto-generated method stub
                    View rowView=view;
    
                    if(rowView==null){
                        LayoutInflater layoutinflate =LayoutInflater.from(TestProjeectActivity.this);
                        rowView=layoutinflate.inflate(R.layout.listviewtext, parent, false);
                    }
    
                    TextView textViewName=(TextView)rowView.findViewById(R.id.textViewName);
    
                    textViewName.setText(usernameArr[position]);
    
                    return rowView;
                }
    
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code that looks like this: <div id="header"> <ul class="tabs"> <li><a href="/user/view"><span class="tab">Profile</span></a></li>
I have a view model that looks like this: public class VenueIndexViewModel : BaseViewModel
I have a view model that has a property that looks like this Property
I have Rails 3.1.2 app with a hierarchical relationship that looks like this: Categories
Hello. I have a list that looks like this one: public class PagedList<T> :
I have a renderer that looks like this: <s:ItemRenderer xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx autoDrawBackground=true> <s:Group
I have a form in my forms.py that looks like this: from django import
I have a ListView setup in details mode that looks like this: When the
Let's say I have a model that looks like this: public class Blog {
I have a data grid that looks like this <tk:DataGrid ItemsSource={Binding Parents} AutoGenerateColumns=False> <tk:DataGrid.Columns>

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.