android - Action Bar icon as up enabled not the title -


how make app icon enabled in actionbarsherlock (not title icon) in whats app.

the title clickable icon since android 4.2.2. whatsapp uses custom view display 2 line title. disables title click along way. can same way:

actionbar actionbar = getsupportactionbar(); actionbar.setdisplayhomeasupenabled(true); actionbar.setdisplayshowtitleenabled(false); actionbar.setdisplayshowcustomenabled(true); actionbar.setcustomview(r.layout.ab_title);  textview title = (textview) findviewbyid(android.r.id.text1); title.settext("title"); 

/res/layout/ab_title.xml:

<textview xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@android:id/text1"     style="@style/textappearance.sherlock.widget.actionbar.title"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:ellipsize="end"     android:gravity="center_vertical" /> 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -