AndroidのSlidingDrawer

フォーラム(掲示板)ルール
フォーラム(掲示板)ルールはこちら  ※コードを貼り付ける場合は [code][/code] で囲って下さい。詳しくはこちら
アバター
みけCAT
記事: 6734
登録日時: 15年前
住所: 千葉県
連絡を取る:

AndroidのSlidingDrawer

#1

投稿記事 by みけCAT » 14年前

またまたC言語の質問ではなくてすみません。

Androidのアプリの作成に挑戦しています。
Eclipse 3.7.2で開発をしていて、対象のOSはAndroid 2.3.3です。

SlidingDrawerを用いて、ボタンを押すと、
画面に配置されているオブジェクトの上にかぶさるように設定画面が出るようにしたいです。
現状のコード(xml)だと、ボタンを押しても下の空きスペースで少ししかせり上がらず、困っています。
イメージとしては、こんな感じにしたいです。
app_image.gif
動作のイメージ画像です
app_image.gif (6.27 KiB) 閲覧数: 1930 回
このようなことはできるでしょうか?
できるなら、どのようにすればいいのでしょうか?
SlidingDrawerにこだわらなくても構いません。
よろしくお願いします。

こちらが現状のxmlです。プロジェクト全体が必要なら、言ってください。

コード:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >


    <TextView
        android:id="@+id/textView2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/text_score"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textSize="60dp" />


    <View
        android:id="@+id/view1"
        android:layout_width="wrap_content"
        android:layout_height="26dp" />

    
    <Button
        android:id="@+id/button1"
        android:layout_width="match_parent"
        android:layout_height="240dp"
        android:text="@string/text_start" />


    <Button
        android:id="@+id/button2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.00"
        android:text="@string/text_stop" />


    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="38dp"
        android:layout_weight="0.00" >

        
        <ProgressBar
            android:id="@+id/progressBar1"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_toLeftOf="@+id/textView1" />


        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:text="@string/text_time"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textSize="30dp" />

    </RelativeLayout>



    <SlidingDrawer
        android:id="@+id/slidingDrawer1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:content="@+id/content"
        android:handle="@+id/handle" >


        <Button
            android:id="@+id/handle"
            android:layout_width="70dp"
            android:layout_height="50dp"
            android:text="@string/text_config" />



        <LinearLayout
            android:id="@+id/content"
            android:layout_width="fill_parent"
            android:layout_height="150dp"
            android:orientation="vertical"
            android:background="#808080" 


            <TextView
                android:id="@+id/textView3"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="@string/text_assignedscore"
                android:textAppearance="?android:attr/textAppearanceLarge" />

        </LinearLayout>
    </SlidingDrawer>

</LinearLayout>
複雑な問題?マシンの性能を上げてOpenMPで殴ればいい!(死亡フラグ)

ISLe
記事: 2650
登録日時: 15年前
連絡を取る:

Re: AndroidのSlidingDrawer

#2

投稿記事 by ISLe » 14年前

現状こうなっているのを

コード:

<LinearLayout>
    ~
    <SlidingDrawer>
    </SlidingDrawer>
</LinearLayout>
こういう構造にしてください。

コード:

<RelativeLayout>
    <LinearLayout>
        ~
    </LinearLayout>
    <SlidingDrawer>
    </SlidingDrawer>
</RelativeLayout>

アバター
みけCAT
記事: 6734
登録日時: 15年前
住所: 千葉県
連絡を取る:

Re: AndroidのSlidingDrawer

#3

投稿記事 by みけCAT » 14年前

ISLeさんの方法でできました。
ありがとうございます。
複雑な問題?マシンの性能を上げてOpenMPで殴ればいい!(死亡フラグ)

閉鎖

“C言語何でも質問掲示板” へ戻る