Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid Tab icons don't show up
    primarykey
    data
    text
    <p>Right now I'm trying to get the Tab layout to work. I've done everything just like in Android TabView tutorial, app runs ok, but the problem is that I dont see any icons that I've defined them in ic_tab_artists.xml. There is text only. </p> <p>I guess it has something to do with theme that is default one or style or whatever. I've tried to change it but it didn't help at all, still just a text.</p> <p>I'm using Android SDK v4.03. </p> <p>I'm sure there are enough Android gurus that will help, so thanks in advance.</p> <p>This is my .xml defining using icons:</p> <pre><code>?xml version="1.0" encoding="utf-8"?&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;!-- When selected, use grey --&gt; &lt;item android:drawable="@drawable/ic_tab_artists_grey" android:state_selected="true" /&gt; &lt;!-- When not selected (default), use white--&gt; &lt;item android:drawable="@drawable/ic_tab_artists_white" /&gt; &lt;/selector&gt; </code></pre> <p>And my main HolePage Activity:</p> <pre><code>@SuppressWarnings("deprecation") public class HolePage extends TabActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.hole_page); //TABS Resources res = getResources(); // Resource object to get Drawables TabHost tabHost = getTabHost(); // The activity TabHost TabHost.TabSpec spec; // Reusable TabSpec for each tab Intent intent; // Reusable Intent for each tab // Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent().setClass(this, HolePageScores.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("scores").setIndicator("Scores", res.getDrawable(R.drawable.tab_scores_icons)) .setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs - Info intent = new Intent().setClass(this, HolePageInfo.class); spec = tabHost.newTabSpec("info").setIndicator("Info", res.getDrawable(R.drawable.tab_scores_icons)) .setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs - Top intent = new Intent().setClass(this, HolePageTop.class); spec = tabHost.newTabSpec("top").setIndicator("Top", res.getDrawable(R.drawable.tab_scores_icons)) .setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs - Hole intent = new Intent().setClass(this, HolePageHole.class); spec = tabHost.newTabSpec("hole").setIndicator("Hole", res.getDrawable(R.drawable.tab_scores_icons)) .setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs - Par intent = new Intent().setClass(this, HolePagePar.class); spec = tabHost.newTabSpec("par").setIndicator("Par", res.getDrawable(R.drawable.tab_scores_icons)) .setContent(intent); tabHost.addTab(spec); //Set default tab2 tabHost.setCurrentTab(1); } } </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.
 

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