2017-11-27 6 views
0

私は現在これを達成しようとしています。 enter image description hereボタンの下にヘルパーテキストを追加する

ボタンにヘルパーテキストを追加しようとしています。しかし、私の現在のコードは苦労しています。

<LinearLayout 
     android:orientation="vertical" 
     android:layout_height="match_parent" 
     android:layout_width="match_parent"> 
    <Button 
      android:id="@+id/login_btnLogin" 
      android:layout_width="412dp" 
      android:layout_height="90dp" 
      android:layout_gravity="center" 
      android:background="@color/myGreen" 
      android:text="Continue" 
      android:textAllCaps="false" 
      android:textSize="30sp" 
      android:textColor="@color/ghostWhiteColor" /> 
</LinearLayout> 
+0

ワンボタン –

+0

サンプル画像の上にRelativeLayoutだけのTextViewを使用することができ、レイアウトやカスタムボタンがされて試してみてください。 setOnClickListenerを使用してボタンにレイアウトを使用できます。 –

+0

https://github.com/medyo/Fancybuttons。カスタムボタンのこのライブラリを簡単に実装することができます。 –

答えて

0

button.thatではないソリューションのこの

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="90dp"> 

    <ImageButton 
     android:layout_width="match_parent" 
     android:layout_height="90dp" 
     android:background="@color/colorAccent" /> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:layout_marginLeft="30dp" 
     android:text="Verify" 
     android:textColor="#fff" 
     android:textSize="25sp" /> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom" 
     android:gravity="center" 
     android:padding="5dp" 
     android:text="By preceding verify I agree terms and conditions." 
     android:textColor="#fff" /> 
</FrameLayout> 
0
Use linaer layout instead of button. 

<LinearLayout 
     android:orientation="vertical" 
     android:layout_height="match_parent" 
     android:layout_width="match_parent"> 
    <LinearLayout 
      android:id="@+id/login_btnLogin" 
      android:layout_width="412dp" 
      android:layout_height="90dp" 
      android:layout_gravity="center" 
      android:background="@color/myGreen"> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:text="Continue" 
      android:textAllCaps="false" 
      android:textSize="30sp" 
      android:textColor="@color/ghostWhiteColor" /> 

    <TextVie 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:text="click to continue..." 
      android:textAllCaps="false" 
      android:textSize="30sp" 
      android:textColor="@color/ghostWhiteColor" /> 
</LinearLayout> 
関連する問題