I want to know whether there is a way to change the alignment of activiy label, like other views can be aligned by android:gravity attribute..
NOTE: Except android:label=" Header "
Thanks in advance..
You have to customize Title Bar for that.
See the Examples Here :
http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/
http://coderzheaven.com/2011/06/16/custom-title-bar-in-android/
You can customize according to your need.
Related
I want my menu items on the BottomNavigationBar to have text-only labels with no icon. Unfortunately, it looks like design_bottom_navigation_item.xml always has a 24x24dp space reserved for the icon, with no publicly-exposed way to set it to gone. And even after getting past that, the label layout is set to a layout_gravity of bottom|center_horizontal, and it doesn't look like there's a way to programatically set layout_gravity to centered.
What is the fastest, easiest way to achieve the goal of a text-only menu item on the bottom nav bar? I'm thinking I can do this by creating a custom version of the item layout, then subclassing BottomNavigationItemView, BottomNavigationMenuView, and BottomNavigationView to specify that custom layout... but that seems like an awful lot of work for one little change. Am I missing something simpler?
dont put iandroid:icon property to your item
Just use the code below. I tried hard to do this easy way but failed.Then I made an alternative. Just use transparent color instead of icon drawble
<item
android:icon="#android:color/transparent"
android:id="#+id/navigation_id"
android:title="title" />
Add this in your dimens file. Then you can add padding according to your navigation view size.
<dimen name="design_bottom_navigation_height"tools:override="true">30dp</dimen>
How can I put the texts in my white-colored textviews in Android in same location like those in my another pic? if I use android:gravity="left|center", it will be in the left-corner in the center, but I dont want it to be 100% left, what to do? is there any margin-type code for text in textView? Any tips would be appreciated, thanks
Use the android:paddingLeft attribute to add some space in your text view.
I want to implement AutoCompleteTextView something like what Gmail app in Android does.
I am not sure how to set "To" fixed text on the left side of AutoCompleteTextView.
How is this implemented? Do I have to put TextView inside AutoCompleteTextView to show "To" label. If I do that my cursor starts from the beginning of AutoCompleteTextView and not after TextView.
How should I achieve this view
You can put a TextView to the left of the AutoCompleteTextView. Use a horizontal LinearLayout for that. You can set the border (the underline with the little ticks) on the linear layout if you want one.
My style of implementation of it is to use android:drawableLeft. Create a drawable(could be image) first which in your case "To". Then apply it in the xml declaration of your AutoCompleteTextView like this.
<AutoCompleteTextView
android:id="#+id/auto_complete_textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/to_drawable_label"/>
I hope this helps. :)
you just need to create an adapter and set it to AutocomleteTextView.
Can we change the colour of title in an Android application.
I want to change the colour of label which has contents Abc Supply Company.
This label is in Manifest file. Can we change the colour for this label.
Looking forward to your reply.
thanks.
I think you want to change color of Application Label that comes in every screen.If i am right then there is no solution
In this case you have use theme for activity in android manifest file like this to remove that label
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen"
Then design you own custom Label in Layout and then you can do whatever you want to do.
Hope this help you :)
Solution for this is known as Custom Title bar in Android, check this article: http://coderzheaven.com/2011/06/custom-title-bar-in-android/
Of course you can do.
You need to get reference of your
Textview yourTextView = ( TextView ) findViewById( R.id.YOUR_TEXT_VIEW );
and then call the function setTextColor( YOUR COLOR );
Hallo everybody,
I'd like to use black color as default text color only in one activity.
I guess, I should use Theme and Styles, but I didn't find any good information relating to my question or to only one activity.
Is it possible to change default text color only for one activity?
If yes, could you give me an example please, how to do this?
Mur
You can add the android:theme tag to just an activity:
<activity
android:name=".SomeActivity"
android:theme="#style/Theme.ForSomeActivity"
/>