Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think you have the wrong approach to using a ListView. Use an adapter to feed the list to the view, and in the ListView layout file, you don't define the rows, you only define the listview itself and a default textview which will show when there are no items in the list. Then you define a separate xml file which will render each row. Then in this row layout you're free to set the text size as you wish.</p> <p>Here's an example of the listview xml (notice the special id's given to the listview and textview, these ARE required):</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:scrollbars="horizontal" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingLeft="8dp" android:paddingRight="8dp"&gt; &lt;ListView android:id="@+id/android:list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:drawSelectorOnTop="false" /&gt; &lt;TextView android:id="@+id/android:empty" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="No records found" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>Then your row layout would be your file without the listview:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:myapp="http://schemas.android.com/apk/res/zaid.quotes.dlama"&gt; &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/Back" android:layout_alignParentBottom="true" android:text="Go Back"&gt;&lt;/Button&gt; &lt;LinearLayout android:layout_width="wrap_content" android:id="@+id/LinearLayout01" android:layout_height="wrap_content" android:layout_alignParentTop="true"&gt; &lt;com.admob.android.ads.AdView android:id="@+id/ad" android:layout_width="fill_parent" android:layout_height="wrap_content" myapp:backgroundColor="#000000" myapp:primaryTextColor="#FFFFFF" myapp:secondaryTextColor="#CCCCCC" android:layout_alignParentTop="true" /&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>And here's a sample of the adapter's getView() method where you will set the row layout file:</p> <pre><code>public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.row_layout, null); } //Now, assuming your adapter has the list of objects to be displayed in 'records': if(records != null) { YourRecord r = records.get(position); if(r != null) { // Populate your views in your row.xml based on data from your record selected (r) } ... } } </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.
    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