Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom list view is not diplaying properly
    primarykey
    data
    text
    <p>I have created an app which uses a custom listview Fragment. But the custom listview is not displaying properly.</p> <p>below attached is my screen shot.</p> <p><img src="https://i.stack.imgur.com/XVaS0.jpg" alt="enter image description here"></p> <p>ANd here is my Xml file of individual row item</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/Jobtitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="7dp" android:paddingRight="7dp" android:paddingTop="2dp" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="@color/green" android:textStyle="bold" &gt; &lt;/TextView&gt; &lt;RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/Jobtitle" android:orientation="horizontal" android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="5dp" android:paddingBottom="5dp"&gt; &lt;TextView android:id="@+id/publishdate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="PubDate:-" android:textColor="@color/textgrey" /&gt; &lt;TextView android:id="@+id/lefttime" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/publishdate" android:layout_alignBottom="@+id/publishdate" android:layout_alignParentRight="true" android:text="Time Left:-" android:textColor="@color/textgrey" /&gt; &lt;/RelativeLayout&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="1dp" android:layout_alignParentLeft="true" android:layout_below="@+id/relativeLayout1" android:background="@drawable/dividr" &gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>and here is the list fragment layout file</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;ListView android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="wrap_content" &gt; &lt;/ListView&gt; &lt;TextView android:id="@android:id/empty" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="No text" &gt; &lt;/TextView&gt; </code></pre> <p></p> <p>And here is my adapter </p> <pre><code> package my.newapp.freelanceeye; import android.content.Context; import android.os.Bundle; import android.support.v4.app.ListFragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; public class joblisted extends ListFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); adapt my=new adapt(getActivity(), R.layout.listrow,m); setListAdapter(my); } Context ctx; public class adapt extends ArrayAdapter&lt;String&gt;{ @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater=(LayoutInflater)ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View row=inflater.inflate(R.layout.listrow,parent,false); return row; //return super.getView(position, convertView, parent); } public adapt(Context context, int textViewResourceId, String[] objects) { super(context, textViewResourceId, objects); ctx=context; } } String[] m={"as","asa","sd","Ad","sad","asda"}; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v=inflater.inflate(R.layout.listfragmnetlayout,container,false); return v; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload