0

I want to set a footer in android fragment. I am using appcomat for action bar and would like to have a bar simialr to action bar with as footer.

Footer will display some information as text .It wont have any clickable buttons.

enter image description here


I have create a mockup of footer as shown below.This will then contain some text. Note the color of footer should be same as action bar.

Also the UI looks very ugly.How can i make it better?

user93796
  • 18,749
  • 31
  • 94
  • 150
  • 1
    Have you noticed the dummy textview that was generated when you create a ViewPager layout? You can modify it and set up your footer. – jyoonPro Jun 07 '14 at 09:57
  • @jyoon :TextView with alignParentBottom = true ? But how do i use same color as action bar ?How can i reuse style? – user93796 Jun 07 '14 at 10:00
  • Um, android:textColor="whatever text color you wish", in your case, it seems like #ffffff – jyoonPro Jun 07 '14 at 10:02
  • I dont want to use "whatever text color you wish" .I want to reuse the style of actionbar. – user93796 Jun 07 '14 at 10:03
  • The color in your picture seems to be `#ff202020` (as detected by ColorCop). Anyway, I guess you can get and set the ActionBar color, as well as that of any other View – Phantômaxx Jun 07 '14 at 10:07
  • Where do i find color style that is used by appcombar lib? – user93796 Jun 07 '14 at 10:09
  • Refer this: http://stackoverflow.com/questions/20913872/android-fragment-application-how-to-add-a-footer – Krupa Patel Jun 07 '14 at 11:16
  • You can force it in styles.xml, as this post shows (OK, it's for the foreground color, but you can easily adapt it for the background color): http://stackoverflow.com/questions/22353414/how-to-change-color-of-actionbars-title-text-on-android-4-3-api-18 – Phantômaxx Jun 07 '14 at 12:48
  • OK, you might want to see this for the colours. http://stackoverflow.com/a/10382463/3463021 – jyoonPro Jun 09 '14 at 07:48

1 Answers1

0

answering my own question : I found the following way better.

Use nested layouts

Android: 2 relative layout divided in half screen

Community
  • 1
  • 1
user93796
  • 18,749
  • 31
  • 94
  • 150