0

Ich bin neu in Android-Entwicklung und ich möchte ein Menü als Floating-Aktion-Taste machen. Ich werde 10 Tasten im Menü und alle im Framelayout haben. Das Problem ist, wenn ich das Gerät rotiere, verschwand die Hälfte der Tasten. Wie kann ich durch die Menütasten blättern?So blättern Floating-Action-Menü im framelayout

<ScrollView 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:fillViewport="true"> 
<FrameLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"> 
<com.github.clans.fab.FloatingActionMenu 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:id="@+id/menu_red" 
    android:layout_gravity="right|bottom" 
    android:layout_marginEnd="@dimen/fab_margin_right" 
    android:elevation="@dimen/button_elevation" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:layout_marginRight="10dp" 
    android:layout_marginBottom="10dp" 
    android:layout_marginLeft="10dp" 
    fab:menu_labels_ellipsize="end" 
    fab:menu_labels_singleLine="false" 
    fab:menu_backgroundColor="#ccffffff" 
    android:layout_marginTop="100dp"> 
    <com.github.clans.fab.FloatingActionButton 
     android:id="@+id/fab1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/ic_star" 
     fab:fab_size="mini" 
     fab:fab_label="B1" 
     fab:paddingEnd="@dimen/activity_horizontal_margin" 
     /> 
    <com.github.clans.fab.FloatingActionButton 
     android:id="@+id/fab2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/ic_star" 
     fab:paddingEnd="@dimen/activity_horizontal_margin" 
     fab:fab_size="mini" 
     fab:fab_label="B2" /> 
    <com.github.clans.fab.FloatingActionButton 
     android:id="@+id/fab3" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/ic_star" 
     fab:fab_size="mini" 
     fab:fab_label="B3" /> 
</com.github.clans.fab.FloatingActionMenu> 
</FrameLayout> 
</ScrollView> 
+1

Setzen Sie den framelayout innerhalb eines Scrollview verwenden können. [bearbeiten] Sie Ihren Post, um den Layout-XML-Code aufzunehmen. – FishStix

Antwort

1

Haben Sie scrollview versucht? Wickeln Sie Ihr Rahmenlayout mit einer Rolle.

<ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 


     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 


      <!--whatever you want in a scroll--> 

     </LinearLayout> 


    </ScrollView> 

Statt lineare Layout, das Sie zum Beispiel eine relative

+0

ja ich habe versucht scroll view aber nicht mit framelayout – kareem

+0

Es muss ein Rahmenlayout sein? Vielleicht können Sie es in eine lineare oder relative ändern. Denken Sie daran, dass eine Bildlaufansicht nur ein Kind haben darf. – kkkkk

+0

was meinst du mit einem Kind? bitte ich denke, das war der Fehler – kareem

Verwandte Themen