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

Auto scroll list to last view position Android
webview links not working
Android. Making the screen go black
How can I receive notifications from GCM when application is stopped
Bluetooth SPP and other Bluetooth Services
What is the optimal bitmap size for drawable ldpi / mdpi / hdpi / xhdpi folders?
How to set text color of Gridview
How to read XML file tag by tag in Android?
Rregister a BroadcastReceiver in Titanium Appcelerator
How to change size of text in application settings?
com.android.ddmlib.SyncException: No space left on device (physical phone not emulator)
Android: How do I create loading screen while access the database
WebView Click Action
android Layout weight programatically
How to get DTEND and DTSTART from UTC millis since epoch to human readable time?
how to call Android mapActivity OnTouchEvent and LocationManager/Geopoint

Categories

HOME
api
object
ns-3
3d
components
soa
mips
parameters
visual-studio-emulator
babeljs
google-admin-sdk
vert.x
trac
odoo-8
opengl-3
lanczos
computer-science
rcloud
extjs4.2
mql5
text-mining
filechannel
powershell-v5.0
imessage
breadth-first-search
undertow
jquery-ias
ios10.2
direct3d11
froala
onload
definitelytyped
fat
tpm
tizen-tv
mustache
autolisp
openwhisk
sendbird
sql-server-ce
git-rewrite-history
reactivekit
diacritics
postgresql-8.4
tcc
placeholder
dynamic-linq
netbeans6.8
openblas
java-6
skin
payload
monkey
flyout
d3-force-directed
atlas
segment-io
ikiwiki
upx
ellucian-scribe
phpgrid
grgit
themoviedb-api
dllimport
rewrite
file-move
video-player
rubaxa-sortable
apache-commons-daemon
fits
grouping-sets
viewer
addressing-mode
easyrtc
mdichild
mobility
lnk
cancellation
malformedurlexception
ora-06550
ie8-compatibility-mode
away3d
ice-cube
neos-server
abstract-data-type
apache-commons-dbutils
screen-size
google-ajax-api
exponentiation
uipagecontrol
dataform
twitterizer
nhprof
photolibrary
resharper-6.0
strtod
scrubyt
int64
firefox-3
flvplayback
business-model

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