android


Android withText option does not work for action bar buttons on Huawei MediaPad (T1-A21L)


The buttons on the action bar on this tablet, if shown with text, suffer from text warping as in the screenshot below:
I tried many possible settings combinations (ifRoom, always, withText,...). Even attempting to manipulate the actual view of the button get me nowhere (or maybe I didn't persevere enough). Setting the widths of the TextView and the parent LinearLayout had no effect unless they're fixed numbers.
Any ideas?
EDIT:
I neglected to mention that attempting to use an icon along with text only shows the icon. This is using the native action bar. Below is the xml of the action button above:
<item
android:id="#+id/itemConfig"
android:showAsAction="ifRoom|withText"
android:title="Network Config"
android:visible="true"/>
Setting the menu item in the following manner:
<item
android:id="#+id/itemConfig"
android:icon="#drawable/ic_action_networkconfig"
android:showAsAction="ifRoom|withText"
android:title="#string/network_config"
android:visible="true"/>
causes this
So in essence, the tablet doesn't like text in its action bar. Any clues?
It looks like your menu code is correct. For reference check my menu item xml:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="#+id/itemConfig"
android:icon="#drawable/icon"
app:showAsAction="withText|always"
android:title="#string/network_config"/>
</menu>
Device will show text with icon only if we have space. You can check with landscape mode. Here is the example
Source:
http://developer.android.com/guide/topics/ui/actionbar.html#ActionItems
If your menu item supplies both a title and an icon—with the title and icon attributes—then the action item shows only the icon by default.
If you want to display the text title, add "withText" to the showAsAction attribute.
Note: The "withText" value is a hint to the action bar that the text title should appear. The action bar will show the title when possible, but might not if an icon is available and the action bar is constrained for space.

Related Links

Firebase auth with an active session when the user id was deleted from the console
Upload image to wordpress via Android
Android. How to clone newest version of Google Calendar?
Align 2 textviews horizontally android
Loading Pictures from URL to imageviews in a ListView
Reducing size of res folder in Android (Multi-language Support)
How to JobScheduler work
How to have a same retrofit client using two rest endpoints at a same time depending on the api getting called
AlertDialog Builder: add event on click outside the dialog
Android voice recorder pause/resume methods
pppd works when executed via adb shell, but fails with 'This system lacks kernel support for PPP' when executed from android app
I want to know is it possible and will it be implemented to record calls on Android 7?
Testing rotation/orientation changes and cannot find what is causing this error [duplicate]
can we directly passe the mobile number to digits
Android: Simulating power button press using intent in terminal simulator
Firebase data not added to the right child

Categories

HOME
search
deep-learning
polymer
eslint
github-for-windows
redux-form
mjml
case
mstest
jwplayer
jsf-2.2
replace
javacc
rom
google-admin-sdk
crystal-reports-2013
accessibility
32bit-64bit
supervisor
gkturnbasedmatch
enterprise-architect
docx
mongodb-csharp
modbus-tcp
entitymanager
scsi
symfony-2.8
chargify
vuejs
google-content-api
nodemcu
lilypond
kendo-mobile
game-theory
angular-translate
cppreference
vex
testcomplete
dotspatial
xbox
left-join
r-grid
code-snippets
least-squares
roblox
servicestack-text
ideascript
modernizr
unordered-map
httr
mesosphere
textsum
posixct
tinkerpop
yii2-user
sundials
mach-o
cd-burning
rsa-archer-grc
javafx-css
greatest-n-per-group
model-associations
expectations
cifilter
project-organization
turbo-prolog
pushbots
nio2
np-spring
rasterize
tfs-workitem
intel-c++
cgi-bin
sapscript
finalbuilder
dulwich
graphics2d
bufferedinputstream
user-permissions
imagefilter
rmysql
functional-java
menubar
bin
hibernate-entitymanager
observium
scringo
cmmi
chart-director
adobe-media-server
josql
apache-commons-dbutils
uipagecontrol
cuteeditor
codebase
cloudfiles
nhprof
luajava
resharper-6.0
isapi-extension
zen
cfwindow
skype4java
dsl-tools
google-wave
int64

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