Android: Add a single page title strip bar

billiout

I have an activity and I want to put a simple title strip like the picture below(Select a category) but I can't find anything on how to do a simple one. Only title strips for tabs. Is anyone know how to implement this? Thanks :)

enter image description here

Christopher Rucinski

I think this will be your best solution - http://javatechig.com/android/listview-with-section-header-in-android.

Check the custom adapter in the link. You could also have multiple headers too, but if you only want one, then you can just have the code like below

package com.javatechig;

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

public class SectionListView extends ListActivity {

    private CustomAdapter mAdapter;

    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        mAdapter = new CustomAdapter(this);
        mAdapter.addSectionHeaderItem("Select A Category"); // <--- here

        for (int i = 1; i < 30; i++) {

            mAdapter.addItem("Item: " + i);

        }

        setListAdapter(mAdapter);

    }

}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Android: Add a single page title strip bar

From Dev

Custom pager title strip in android

From Dev

How to add page title and icon in android FragmentPagerAdapter

From Dev

How to add menu and settings option to the customized title bar of android?

From Dev

Add switch button in Alert Dialog title bar in Android

From Dev

How to add multiple pages to single page navigation bar in dotCMS

From Dev

Can we add navigation bar with dropdown menu on single page website?

From Dev

Page View Navigation Bar Title

From Dev

Android: remove title bar error

From Dev

How to remove title bar in android?

From Dev

Changing background android title bar

From Dev

Remove app title bar android

From Dev

Android layout title bar is not visible

From Dev

Changing background android title bar

From Dev

Android shared title bar with functionality

From Dev

Android 4.2 Title Bar over Action Bar

From Dev

Android Navigation Drawer with Page Sliding tab Strip

From Dev

iOS - add image and text in title of Navigation bar

From Dev

How to add an image in the title bar using html?

From Dev

How to add widgets to title bar using tkinter?

From Dev

How to add Tool bar title at the center of layout

From Dev

iOS - add image and text in title of Navigation bar

From Dev

how to add search bar under the navigation title

From Dev

Xamarin - Add title and button in action bar

From Dev

Add fixed bar to HTML page

From Dev

Add fixed bar to HTML page

From Dev

How to hide the title bar for of android app?

From Dev

Set OnClick Listener on Action Bar Title in Android

From Dev

How to set the title of action bar in center in Android

Related Related

HotTag

Archive