Android tabs menu example - android

How I can delete upper grey line ?
https://gist.github.com/germanboy/9618172 --->> codes

You should modify the main.xml file , You should change the framelayout property,
for example background

Related

Removing icon from BottomNavigationView

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 to set Relative Layout as default layout

I usually use Relative layout for most of my activity. I want to make Android studio create Relative layout by default when I create new activity, instead of Constraint Layout. Is there a way to do that?
Right click on layout folder -> New -> Edit File Templates...
A dialog opened, go to "Other" tab.
Change the content of
"LayoutResourceFile.xml" and "LayoutResourceFile_vertical.xml"
Change root tag to the type of layout you want. Hope this help :)
goto
'...\Android\Android Studio\plugins\android\lib\templates\activities\common\root\res\layout\simple.xml'
and change default layout

Can't select TextView in either DesignTab nor is it displayed in the XML file

I'm pretty new at this. The problem accurs right after I've created a project with a blank activity. On the screen appears a "Hello World!" TextView but this TextView isn't displayed in the XML File and I can't select it in the Designtab but in order to delete it I either need to select it in the Designtab or delete the code in the XML File. How can I do this?
http://i.stack.imgur.com/g7Moi.png
This is a picture of the Preview Page in Android Studio with the XML Code to the left.
Thanks for your help!
If you open the content_main.xml layout file, you should see the "Hello World" TextView. You are currently using the include tag to load a seperate xml file
This is the standard auto-generated code by Android Studio. In the activity_main.xml you have the code for the Toolbar and the FloatingActionButton and it is included another xml file content_main.xml where you put all the elements you want.

Android - EditText error changes position on keyboard open/close

I am using editText.setError() attribute but the onKeyboard open/close the error float message changes position to be many pixels higher than the editText instead of being right under it.
I have added:android:windowSoftInputMode="adjustPan" to the activity at the manifest file and at the EditText xml.
How can i fix it?
Yeah,that's your xml maybe some error.you can Modify the layout ,mostly the edittext layout group ,you should change the background to transparent bellow the windowSoft. In a word ,take notice the layout ,Clever use of transparent at the bottom .

android button green

i would like to have tha default button but not in gray.
I need to change the color green/blue/red.
I would like to do this thanks to xml but also from the code.
I need to have a green button which change the color of all the other button.
It's why i need to change from xml and from the code.
Define you colors in the color resource so it is easier to apply your desired colors via code or xml.

Categories

Resources