Vc não está utilizando ToolBar neh? Se sim, so conheço esse jeito .
Para a ActionBar default ou a da appCompat:
| private TextView getActionBarTextView() { | |
| TextView titleTextView = null; | |
| int actionBarTitleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android"); | |
| if (actionBarTitleId <= 0) { | |
| actionBarTitleId = android.support.v7.appcompat.R.id.action_bar_title; | |
| } | |
| if (actionBarTitleId > 0) { | |
| titleTextView = (TextView) findViewById(actionBarTitleId); | |
| } | |
| if (titleTextView != null) { | |
| titleTextView.setTextColor(getResources().getColor(R.color.white)); | |
| FontUtils.setRobotoFont(this, titleTextView, ROBOTO_BOLD); | |
| } | |
| return titleTextView; | |
| } |
Em quarta-feira, 10 de dezembro de 2014 13h30min07s UTC-2, Orlando Cesar Martins Silva escreveu:
Boa tarde a todos. Gostaria de saber se existe alguma forma de colocar um evento onClick no ActionBar inteiro, Mais pode ser somente no titulo, eu tentei da seguinte forma:final int abTitleId = getResources().getIdentifier("action_bar_title" , "id", "android"); findViewById(abTitleId).setOnClickListener (new View.OnClickListener() { @Override public void onClick(View v) { //Do something } });Porém oabTitleId sempre me retorna null. Estou utilizando o suporte: android.support.v7.app.ActionBar Desde já agradeço.Forte abraço a todos.
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.






0 comentários:
Postar um comentário