android


Android actionbar sherlok doesn't show divider


I'm using the sherlok-actionbar and trying to apply a divider between the action buttons.
I have th style but the dividers are not visible, why?
<style name="Theme.SherlockCustom" parent="#style/Theme.Sherlock.Light">
<item name="abBackground">#drawable/actionbar_gradient</item>
<item name="abIcon">#drawable/logo</item>
<item name="abDivider">#drawable/ab_divider</item>
</style>
Thanks!
ActionBarSherlock v3.5 was updated to include the sources from Ice Cream Sandwich for all action-item related views and classes. This means that the rules for placing a divider between two action items follows the same rules as it would on ICS.
A divider would only be shown between the following:
Text-only followed by text-only
Icon-only followed by text-only
Text and icon followed by text-only
If you want to override this behavior (on pre-3.0 only) make the following change to ActionItemView.java:
What you can do is to add a view next to the actionbar item that will look like the separator (works on all Android versions)
<item
android:actionViewClass="com.example.ActionSeparatorView"
android:showAsAction="always"
android:title="#null"/>
and the ActionSeparatorView is a simple extension of the ImageView with the drawable you want to show as a separator
public class ActionSeparatorView extends ImageView {
public ActionSeparatorView (Context context) {
super(context);
setImageDrawable(getResources().getDrawable(R.drawable.separator));
}
}

Related Links

Android Runtime Permissions - App Crashes when user revokes permission. How to handle it?
Disable automatic publishing on Google Play
Android Studio Toolbar With NO Layouts
How does AppIndex.AppIndexApi work?
Genymotion virtual device loads too slow
How to get programmatically, Android Application stats without root?
Keeping React native app opened after opening another app
How to clear data in listview and load new data in listview in android on swipe to refresh?
Unity - can't see canvases after updating to 5.3.5? But they are still there?
SignalR vs Google Cloud Messaging
Why Proguard runs despite having minifyEnabled in gradle config?
Parse: push notification GCM Android not delivered via Parse
What is lifecycle for RecyclerView adapter?
Bluetooth: Send data from each phone to the others
How can I place the icons on the top of the circular image android?
Access realm object inside AsyncTask

Categories

HOME
uml
embedded
phantom-dsl
gridview
apache-flink
css3
jmx
mstest
sitecore
replace
nested-if
spring-session
jquery-ui-sortable
supervisor
code-generation
flash-player
standards
easyphp
google-container-registry
foreign-keys
string-concatenation
definitelytyped
fat
angular-translate
browser-sync
biztalk-rule-engine
latitude-longitude
zoomify
apache-stanbol
lpsolve
bindingnavigator
outputcache
knime
lampp
openrasta
x-ray
payara-micro
seq
cronexpression
simplepie
builtins
google-cloud-console
kiosk
sklearn-pandas
dynamics-nav-2016
text-search
branch-and-bound
ocra
snoop
snackbar
cakephp-2.7
delayed-execution
cosine-similarity
angular-gettext
contrast
metatrader5
entry-point
paw
imagefilter
verold
tinyxml
paste
twitter-bootstrap-rails
artemis
kendo-dataviz
away3d
tlf
octal
cascadingdropdown
apache-abdera
argouml
booksleeve
intersect
tree-balancing
ilasm
relative
flex-mobile
umra
inline-formset
uideviceorientation
ie-compatibility-mode
alsb
int64
flvplayback
contentpresenter
wcf-proxy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App