2016-10-26 11 views
0

ScrollViewを使用する小さなアンドロイドアプリを開発しています。私はすでにRelativeLayoutScrollViewに持っています。私は既に商品でいっぱいです。今度は、スクロールバーのスクロールバーが表示されているにもかかわらず、もっと多くのアイテムを追加するためのスペースを作成するためにスクロールしたいと思います。それを行う方法はありますか?私は、デザインビューで作業好きなのにここでアンドロイドスタジオでのスクロール表示のスクロール

は、XMLコードです:あなたはスクリーンショットで見ることができるように

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/activity_new_reminder" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="0dp" 
    android:paddingLeft="0dp" 
    android:paddingRight="0dp" 
    android:paddingTop="0dp" 
    tools:context="com.steveops.locationreminder.NewReminderActivity"> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true"> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="700dp" 
      android:padding="5dp" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentStart="true" 
      android:layout_marginLeft="11dp" 
      android:layout_marginStart="11dp"> 

      <TextView 
       android:text="REMINDER NAME" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/textView" /> 

      <EditText 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:inputType="textPersonName" 
       android:text="Name" 
       android:ems="10" 
       android:id="@+id/editText2" 
       android:layout_below="@+id/textView" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <TextView 
       android:text="ACTIVATE ON" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/textView5" 
       android:layout_below="@+id/editText2" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <CheckBox 
       android:text="M" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/textView5" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" 
       android:id="@+id/checkBox7" /> 

      <CheckBox 
       android:text="T" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/textView5" 
       android:layout_toRightOf="@+id/checkBox7" 
       android:layout_toEndOf="@+id/checkBox7" 
       android:id="@+id/checkBox8" /> 

      <CheckBox 
       android:text="W" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignTop="@+id/checkBox8" 
       android:layout_toRightOf="@+id/checkBox8" 
       android:layout_toEndOf="@+id/checkBox8" 
       android:id="@+id/checkBox9" /> 

      <CheckBox 
       android:text="T" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignTop="@+id/checkBox9" 
       android:layout_toRightOf="@+id/checkBox9" 
       android:layout_toEndOf="@+id/checkBox9" 
       android:id="@+id/checkBox10" /> 

      <CheckBox 
       android:text="F" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignTop="@+id/checkBox10" 
       android:layout_toRightOf="@+id/checkBox10" 
       android:layout_toEndOf="@+id/checkBox10" 
       android:id="@+id/checkBox11" /> 

      <CheckBox 
       android:text="S" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignTop="@+id/checkBox11" 
       android:layout_toRightOf="@+id/checkBox11" 
       android:layout_toEndOf="@+id/checkBox11" 
       android:id="@+id/checkBox12" /> 

      <CheckBox 
       android:text="S" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignTop="@+id/checkBox12" 
       android:layout_toRightOf="@+id/checkBox12" 
       android:layout_toEndOf="@+id/checkBox12" 
       android:id="@+id/checkBox13" /> 

      <TextView 
       android:text="BETWEEN" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/textView7" 
       android:layout_below="@+id/checkBox7" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <TimePicker 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/timePicker" 
       android:layout_below="@+id/textView7" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" 
       android:layout_toStartOf="@+id/checkBox12" 
       android:layout_alignParentRight="true" 
       android:layout_alignParentEnd="true" /> 

     </RelativeLayout> 
    </ScrollView> 

</RelativeLayout> 

ScrollViewのスクロールバーが表示されますが、私はスクロールすることはできませんよ例えば、新しい時間ピッカーを追加するのに十分なスペースを作成する。私は理にかなっているといい。

+0

xmlの一部のコードを投稿できますか/ – vidulaJ

+0

コードが正常に動作していますスクロールが機能していて、スペースがあるだけでなく、何が欲しいのですか? –

+0

こんにちは、@あなたのコードが働いています..きれいにして、あなたのプロジェクトを再構築してください。 –

答えて

0

このコードを試してみてくださいは、解決策を見つけました。エディタで選択したデバイスをカスタムデバイスに変更したところ、すぐに動作するようになりました。私はエディタが何とか凍結されたと思っています。それがスクロールしていない理由です。

私はこのように画面サイズを超えるアプリを開発したことはありません。

ご協力いただきありがとうございました。あなたの回答は高く評価されています。

1

スクロールビュー内の相対レイアウトではなく、向きを垂直にして、linearlayoutを使用します。それが働いた理由を私はしませんが

+0

まだ動作しません。私はテキストエディタから別の時間ピッカーを追加しましたが、それは隠されていて、それを表示にスクロールできません。 – Steve

+0

外側の相対位置も同様にlinearlayoutに変更します。デフォルトで時刻選択がtrueになっていることを確認してください。 –

+0

どちらもうまくいかないようです。私は、デザインビューでスクロールしてテキストエディタで作業することはできないと仮定します。 – Steve

1

<ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true"> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:padding="5dp" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentStart="true" 
      android:layout_marginLeft="11dp" 
      android:layout_marginStart="11dp" 
      android:id="@+id/kk"> 

      <TextView 
       android:text="REMINDER NAME" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/textView" /> 

      <EditText 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:inputType="textPersonName" 
       android:text="Name" 
       android:ems="10" 
       android:id="@+id/editText2" 
       android:layout_below="@+id/textView" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <TextView 
       android:text="ACTIVATE ON" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/textView5" 
       android:layout_below="@+id/editText2" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <CheckBox 
       android:text="M" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/textView5" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" 
       android:id="@+id/checkBox7" /> 

      <CheckBox 
       android:text="T" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/textView5" 
       android:layout_toRightOf="@+id/checkBox7" 
       android:layout_toEndOf="@+id/checkBox7" 
       android:id="@+id/checkBox8" /> 

      <CheckBox 
       android:text="W" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignTop="@+id/checkBox8" 
       android:layout_toRightOf="@+id/checkBox8" 
       android:layout_toEndOf="@+id/checkBox8" 
       android:id="@+id/checkBox9" /> 

      <CheckBox 
       android:text="T" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignTop="@+id/checkBox9" 
       android:layout_toRightOf="@+id/checkBox9" 
       android:layout_toEndOf="@+id/checkBox9" 
       android:id="@+id/checkBox10" /> 

      <CheckBox 
       android:text="F" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignTop="@+id/checkBox10" 
       android:layout_toRightOf="@+id/checkBox10" 
       android:layout_toEndOf="@+id/checkBox10" 
       android:id="@+id/checkBox11" /> 

      <CheckBox 
       android:text="S" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignTop="@+id/checkBox11" 
       android:layout_toRightOf="@+id/checkBox11" 
       android:layout_toEndOf="@+id/checkBox11" 
       android:id="@+id/checkBox12" /> 

      <CheckBox 
       android:text="S" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignTop="@+id/checkBox12" 
       android:layout_toRightOf="@+id/checkBox12" 
       android:layout_toEndOf="@+id/checkBox12" 
       android:id="@+id/checkBox13" /> 

      <TextView 
       android:text="BETWEEN" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/textView7" 
       android:layout_below="@+id/checkBox7" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <TimePicker 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/timePicker" 
       android:layout_below="@+id/textView7" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" 
       android:layout_toStartOf="@+id/checkBox12" 
       android:layout_alignParentRight="true" 
       android:layout_alignParentEnd="true" /> 

     </RelativeLayout> 
    </ScrollView> 

</RelativeLayout> 
+0

私はすでに解決策を持っています。私のエディタは何とか凍結されたと思います。しかし、今働いている。助けてくれてありがとう。 – Steve

関連する問題