Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: Own Font in ListView
    primarykey
    data
    text
    <p>I'm trying to have my own font in a listview using Java in Android OS 2.3.x</p> <p>After reading the following links, i'm stuck:</p> <p><a href="http://developer.android.com/guide/topics/ui/themes.html" rel="nofollow">http://developer.android.com/guide/topics/ui/themes.html</a> http://stackoverflow.com/questions/4576441/custom-font-in-android-listview <a href="http://androidforums.com/android-lounge/143874-custom-typface-listview-row-layout.html" rel="nofollow">http://androidforums.com/android-lounge/143874-custom-typface-listview-row-layout.html</a></p> <p>i can't post something usefull here.</p> <p>My main problems are:</p> <ul> <li>Why can't i change the Font for a listview, using setTypeface?</li> <li>Why can't i define a Font for ALL texts in my application without putting it in every activity again?</li> <li>Is there a documentation, which handles this problems? The Android SDK documentation is lacking a huge amount of details, like at which version otf Fonts are working.</li> </ul> <p>I know that i have to learn many things and i'm ready as much books about this topics as i can. But after two days guessing and trying around, i have to ask for help.</p> <p>Propably someone can push me in the right direction ;)</p> <p>To give you a small idea, i tried to clean up some code:</p> <p>File: res/layout/scores.xml (snippet from it)</p> <pre><code>&lt;ListView android:id="@+id/android:list" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#00000000" android:cacheColorHint="#00000000" android:transcriptMode="disabled" &gt; &lt;/ListView&gt; </code></pre> <p>File: src/notneededasinfo/ScoresActivity.java (snippet from it)</p> <pre><code>Resources myResources = getResources(); Typeface tf = Typeface.createFromAsset(myResources.getAssets(),"fonts/searstower.ttf"); TextView tv = (TextView) findViewById(android.R.id.list); tv.setTypeface(tf); </code></pre> <p>Thx for help!</p>
    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.
 

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