app name displayed in android device
hi i am a new developer and i am just trying to create some apps of my own. In my app i have placed two buttons at the bottom, the problem is the name of my a开发者_JAVA技巧pp is been displayed in the top of the page and the main page is not visible fully and so the buttons at bottom are not visible. how to solve this.....
The top bar is controlled using an Activity Theme which you can read more about here.
On top of that, you should be using one of the more flexible layouts like RelativeLayout or LinearLayout that will automatically adjust the placement of your items on screen within the available space. You can read more about those here.
You can use the following to make the title bar (where your app's name appear) go away:
requestWindowFeature(Window.FEATURE_NO_TITLE);
Call it inside onCreate()
, just after the call to super.onCreate()
Avoid using AbsoluteLayout
and try using RelativeLayout
in the following way to achieve what you want:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mother_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button android:id="@+id/btn_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Button Left" />
<Button android:id="@+id/btn_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="Button Rigth" />
</RelativeLayout>
精彩评论