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 trialYakir Gabay
2,705 PointsImage 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
2,705 PointsIt 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.
Ozhan Saat
Courses Plus Student 4,002 PointsDid you remove the toolbar in the xml?
Yakir Gabay
2,705 PointsI 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
2,705 PointsI don't know if I am allowed attaching some code here..
Ozhan Saat
Courses Plus Student 4,002 PointsIn your layout folder do you have a activity_main and a content_main?
Ozhan Saat
Courses Plus Student 4,002 PointsIf 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);