Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build an Interactive Story App (Retired) User Input Hiding the ActionBar with an App Theme

Yakir Gabay
Yakir Gabay
2,705 Points

Image alignment: Can't get it to the top after removing the action bar ..

I am running Android Studio 1.5.1, applied: "Theme.AppCompat.Light.NoActionBar" The Action Bar disappeared but the main image stays at the same location instead of filling the gap of the missing action bar.

Thank you :)

4 Answers

Yakir Gabay
Yakir Gabay
2,705 Points

It did the trick! By removing these lines: <CODE> <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" /> </CODE>

For now it's looking good just hope the button and text input underneath will be easily controlled. Will check it.

Thank you for the prompt and great help.

Did you remove the toolbar in the xml?

Yakir Gabay
Yakir Gabay
2,705 Points

I think I did, it doesn't show at the xml file and I checked the styles.xml in version 21. The theme is updated. The action bar is gone but the picture is not taking its place, there is just a blank space there..

Yakir Gabay
Yakir Gabay
2,705 Points

I don't know if I am allowed attaching some code here..

In your layout folder do you have a activity_main and a content_main?

If you haven't done so already, delete this section from activity_main

<android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay">

    <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" />

</android.support.design.widget.AppBarLayout>

And this section from your MainActivity Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar);