android


Custom Toolbar Title not work correctly


i'm trying to set i Custom Toolbar Title from here :
Android toolbar center title and custom font
But title is still appear like below picture :
Here is Toolbar XML :
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/AppTheme.PopupOverlay">
<TextView
android:id="#+id/toolbar_title"
android:textColor="#FFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="#style/TextAppearance.AppCompat.Widget.ActionBar.Title"
android:layout_gravity="center" />
</android.support.v7.widget.Toolbar>
JAVA :
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
TextView mTitle = (TextView) toolbar.findViewById(R.id.toolbar_title);
/*Start Font Face*/
Typeface tf = Typeface.createFromAsset(getAssets(), "Limelight.ttf");
mTitle.setTypeface(tf);
/*Rnd Font Face */
setSupportActionBar(toolbar);
mTitle.setText(toolbar.getTitle());
Use getSupportActionBar().setTitle("") to hide default title.
Try this:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("");
TextView mTitle = (TextView) toolbar.findViewById(R.id.toolbar_title);
Typeface tf = Typeface.createFromAsset(getAssets(), "Limelight.ttf");
mTitle.setTypeface(tf);
mTitle.setText("ARTISTIC");

Related Links

TextToSpeech is null in onPauseFragment
How can I style a SearchView according to its state?
Draw polygon on google map and get the selected area
Task 'connectedAndroidTest' not found in root project
UIAutomator Tests fail to start on real devices: 'java.lang.IncompatibleClassChangeError'
How to display an image in a Meteor Cordova app on Android?
Android: unable to read from sharedpreferences
android requestSingleUpdate questionable behavior
What is diff between requestIdToken and requestServerAuthCode in google singnin
Best way to save a Firebase Reference in code
Android App Shortcuts doesn't work
Android ViewPager/ListView weird display bug
Android React - Getting “Requiring unknown module react”
Android Notification.Builder vs NotificationCompat.Builder
Reusage of XML classes in Greendao
Android clear activity from memory

Categories

HOME
windows
search
hyperlink
delphi-7
apache-flink
sitecore
hugo
crystal-lang
opengl-3
elasticsearch-5
mql5
jquery-ui-sortable
mxgraph
radgridview
capistrano3
microsoft-dynamics-nav
aws-sdk
vuejs
jmp
sencha-touch
windows-xp
dpdk
interpreter
mount
corpus
ms-access-2003
bioinformatics
jaws
dumpbin
hibernate-validator
jett
indy10
sql-delete
roblox
apic
ideascript
gdata
signals-slots
tasm
postgresql-8.4
softmax
double-click
proget
linter
clarifai
gitlist
robomongo
rserve
static-cast
mach-o
flyout
cd-burning
django-1.10
taocp
cronexpression
meteor-packages
winusb
envi
model-associations
thread-sleep
false-sharing
jparsec
mobiledoc-kit
crouton-os
highland.js
jnlua
opserver
eoferror
dulwich
procedural-programming
ejb-2.x
appserver
insight.database
create.js
tinyxml
twitter-bootstrap-rails
amslidemenu
ui-select2
route-provider
chart-director
preload
mkv
saleslogix
paginator
subproject
failing-tests
kqueue
virtualpathprovider
uipagecontrol
twitterizer
hbm2java
mathematical-notation
visualj#
entitykey
unmanagedresources
java1.4
contentpresenter

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