0

을 표시하지 :있는 LinearLayout은 다음 코드에서 버튼

<ScrollView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     xmlns:android="http://schemas.android.com/apk/res/android"> 

    <LinearLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:paddingLeft="16dp" 
      android:paddingRight="16dp" 
      android:orientation="vertical"> 

     <TextView 
       android:layout_marginTop="20dp" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textSize="27sp" 
       android:text="@string/create_card_text"/> 

     <TextView 
       android:layout_marginTop="20dp" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textSize="24sp" 
       android:textColor="#ff949494" 
       android:text="@string/create_card_info_text_one"/> 

     <EditText 
       android:id="@+id/name" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="40dp" 
       android:hint="Name"/> 

     <EditText 
       android:id="@+id/email" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="20dp" 
       android:inputType="textEmailAddress" 
       android:hint="Email"/> 

     <TextView 
       android:id="@+id/phone_number" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:textSize="20sp" 
       android:layout_marginLeft="10dp" 
       android:layout_marginTop="20dp" 
       android:hint="Phone Number"/> 

     <Button 
       android:id="@+id/next_button" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="20dp" 
       android:layout_marginLeft="280dp" 
       android:text="@string/create_card_next_button" 
       android:onClick="next"/> 

    </LinearLayout> 

</ScrollView> 

버튼은 그냥 표시되지 않습니다. 무엇이 잘못 될 수 있습니까?

+2

당신의 marginleft는 huuuuge입니다! – Merlevede

+0

@K_K 아래 코드를 시도해보고 작동하는지 여부를 알려주십시오. – InnocentKiller

답변

1

이렇게 해보십시오. 당신은 너무

android:layout_marginLeft="20dp" 또는 뭔가와 이것을 대체 할 android:layout_marginLeft="280dp"을 설정 한

그래서 기본적으로 당신이 280dp 왼쪽 여백을 설정 한 생각이

<Button 
    android:id="@+id/next_button" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="20dp" 
    android:layout_marginLeft="20dp" 
    android:text="@string/create_card_next_button" 
    android:onClick="next"/> 

같이 보일 것이다 버튼의 코드 어떤 문제가 발생하여 화면에서 꺼내는 경우 20dp으로 설정하거나 화면 요구 사항에 따라 다른 설정을 했으므로 작동해야합니다.