Android nagative drawer icon with title

Source: Internet
Author: User

<?xml version= "1.0" encoding= "Utf-8"?><resources> <string name= "App_name" >xxx</string> &L T;string name= "Navigation_drawer_open" >open navigation drawer</string> <string name= "Navigation_drawer_ Close ">close navigation drawer</string> <string name=" Action_example ">example action</string> &    Lt;string name= "action_settings" >Settings</string> Zhao Archive QQ463431476 <string-array name= "sections" > <item>xxx</item> </string-array><string-array name= "Section_titles" > <item>xxx</ item> </string-array><string-array name= "sections_icons" > <item> @drawable/see</item> &l t;item> @drawable/settings</item> <item> @drawable/figure</item> <item> @drawable/wifi </item> <item> @drawable/mic</item> <item> @drawable/voice</item></string-array >

http://www.cnblogs.com/xiaobo-Linux/QQ463431476

http://www.cnblogs.com/xiaobo-Linux/

public void onsectionattached (int number) { //title string[] Stringarray = Getresources (). Getstringarray ( R.array.section_titles); Mtitle = stringarray[number-1]; Switch (number) {case 1: Getsupportfragmentmanager (). BeginTransaction () . Replace (R.id.container, new Robot ()). commit (); break; }

//Data adapter final TypedArray TypedArray = Getresources (). Obtaintypedarray (r.array.sections_icons); Mdrawerlistview.setadapter (New Arrayadapter<String>(Getactionbar (). Getthemedcontext (), Android. R.layout.simple_list_item_activated_1, Android. R.id.text1, Getresources (). Getstringarray (r.array.sections)) {@Override Publ IC view GetView (int position, view Convertview, ViewGroup parent) {View V = super.getview (position, conver                TView, parent);                int resourceId = Typedarray.getresourceid (position, 0);                drawable drawable = Getresources (). getdrawable (ResourceId);                ((TextView) v). Setcompounddrawableswithintrinsicbounds (drawable, NULL, NULL, NULL);            return v;        }        }); 

@android:d Rawable/xxx is the image that comes with the SDK Android system

C:\Program Files (x86) \android\sdk\platforms\android-15\data\res\drawable-xhdpi

Android nagative drawer icon with title

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.