• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to fix the header titles section?

titleFix.jpg

How to Fix the header titles (Flag, Country and Capital) section? Currently titles also scrolling.

Refer below header section layout.

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:background="@color/colorAccent"
    android:layout_alignParentTop="true"
    android:layout_height="70dp">

    <TextView
        android:layout_width="75dp"
        android:text="Flag"
        android:textSize="18dp"
        android:textColor="#FFFFFF"
        android:textStyle="bold"
        android:gravity="center"
        android:id="@+id/h_flag"
        android:layout_marginLeft="15dp"
        android:layout_height="match_parent" />

    <TextView
        android:layout_width="75dp"
        android:layout_weight="1"
        android:text="Country"
        android:textSize="18dp"
        android:textColor="#FFFFFF"
        android:textStyle="bold"
        android:gravity="center"
        android:id="@+id/h_country"
        android:layout_marginLeft="10dp"
        android:layout_height="match_parent" />

    <TextView
        android:layout_width="0dp"
        android:layout_weight="1"
        android:text="Capital"
        android:textColor="#FFFFFF"
        android:textSize="18dp"
        android:textStyle="bold"
        android:gravity="center"
        android:id="@+id/h_capital"
        android:layout_height="match_parent" />

</LinearLayout>
 
Difficult to answer from the information provided.
Is the header section an item in your ListView? If that's true it will scroll off the screen.
 
Are you adding the Flag/Country/Capital layout to your ListView?
 
Back
Top Bottom