2017-11-30 20 views
-7

私はこのデザインを実現しようとしていますlike this。しかし、強調表示された部分にはまった。私はどのように強調表示された部分を作成することができません。このデザインはどのように入手できますか?

私が作成できるもの。 Check Here. 画像のハイライト部分のみをチェックしてください。私はボタンに沿ってデザインのようなラウンドカーブをデザインすることはできません。

コード:

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.widget.CardView > 

    <android.support.constraint.ConstraintLayout> 

     <android.support.constraint.ConstraintLayout 
      android:id="@+id/card_view"> 

      </android.support.constraint.ConstraintLayout> 


     <android.support.design.widget.FloatingActionButton 
      android:id="@+id/fabDone" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center|bottom" 
      android:layout_marginEnd="8dp" 
      android:layout_marginStart="8dp" 
      android:layout_marginTop="8dp" 
      android:clickable="true" 
      app:fabSize="normal" 
      app:layout_constraintEnd_toEndOf="parent" 
      app:layout_constraintStart_toStartOf="parent" 
      app:layout_constraintTop_toBottomOf="@+id/card_view" 
      app:srcCompat="@drawable/ic_action_plus" /> 

    </android.support.constraint.ConstraintLayout> 

</android.support.v7.widget.CardView> 
+0

とダニの画像を使用してください。私もコードをアップロードしました。 –

+3

それは広すぎます。つまり、質問を編集して、適切な回答を特定するのに十分な詳細で特定の問題に限定してください。一度に複数の異なる質問をしないでください。この質問を明確にするための[ヘルプ]ページ(https://stackoverflow.com/help/how-to-ask)を参照してください。 –

+0

おそらくあなたの質問を編集して、人々が自分の投票を削除できるようにします。 –

答えて

1

あなたが望むようにそのまったく同じこのレイアウトを試してみてください。

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:padding="8dp" 
    android:background="#DDDDDD" 
    android:orientation="vertical"> 

    <android.support.v7.widget.CardView 
     android:id="@+id/cv1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:cardCornerRadius="4dp" 
     app:cardElevation="1dp" 
     app:cardUseCompatPadding="true"> 

     <ScrollView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      app:layout_constraintEnd_toEndOf="parent" 
      app:layout_constraintStart_toStartOf="parent"> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="vertical"> 

       <TextView 
        android:id="@+id/memberPlanId" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Not Selected" /> 

       <Switch 
        android:id="@+id/partToggle" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:checked="true" 
        android:text="Part Amount" /> 

      </LinearLayout> 
     </ScrollView> 
    </android.support.v7.widget.CardView> 

    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/fabDone" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/save_black_24dp" 
     app:layout_anchor="@+id/cv1" 
     app:elevation="1dp" 
     app:backgroundTint="@color/white" 
     app:layout_anchorGravity="center|bottom" /> 
</android.support.design.widget.CoordinatorLayout> 

ノート・人々は私の質問をd​​ownvotingなぜ誰もが説明できるサークル色の背景

出力

+0

ねえ、私はボタンの下にラウンドのようなスタイルを追加したいと思います。質問に記載されているように、画像最初 –

+0

@ Ankur_009ちょうど私の答えを更新して待って –

+0

大丈夫@Abhishekありがとう –

関連する問題