Java androidxml布局中的按钮
我正在使用一些同事为我找到的一个软件包,它允许滑块从顶部开始滑动到底部。我需要在滑块后面添加内容,但我不确定将其放在XML中的什么位置。也许我必须添加一个线性布局,但我不确定。我只需要添加一个位于屏幕中央的按钮。我认为需要将其放入以下代码中:Java androidxml布局中的按钮,java,android,xml,layout,button,Java,Android,Xml,Layout,Button,我正在使用一些同事为我找到的一个软件包,它允许滑块从顶部开始滑动到底部。我需要在滑块后面添加内容,但我不确定将其放在XML中的什么位置。也许我必须添加一个线性布局,但我不确定。我只需要添加一个位于屏幕中央的按钮。我认为需要将其放入以下代码中: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" andro
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:ns="http://schemas.android.com/apk/res/it.sephiroth.demo.slider">
<Button
android:id="@+id/button_open"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="@string/open"
android:layout_centerInParent="true"
android:visibility="gone" />
<it.sephiroth.demo.slider.widget.MultiDirectionSlidingDrawer
xmlns:my="http://schemas.android.com/apk/res/it.sephiroth.demo.slider"
android:id="@+id/drawer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
ns:content="@+id/content"
ns:direction="topToBottom"
ns:handle="@+id/handle" >
<include
android:id="@id/content"
layout="@layout/pen_content" />
<ImageView
android:id="@id/handle"
android:layout_width="wrap_content"
android:layout_height="40px"
android:src="@drawable/sliding_drawer_handle_bottom" />
</it.sephiroth.demo.slider.widget.MultiDirectionSlidingDrawer>
</RelativeLayout>
我还想把按钮放在抽屉后面。
任何帮助都会很好 试试这个:
Try This:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:ns="http://schemas.android.com/apk/res/it.sephiroth.demo.slider">
<LinerLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button_open"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="@string/open"
android:layout_centerInParent="true"
android:visibility="gone" />
</LinerLayout