0

Fragment은 다른 단서로 이어지고 두 번째 단락에는 사용자가 채우기 위해 EditText이 있습니다.EditText를 클릭하면 순간적으로 단편이됩니다.

먼저 EditText을 클릭하면 전체 조각이 약 1 초 동안 투명 해지고 이전 조각을 볼 수 있습니다.

다른 사람을 클릭하면 EditText 님이 더 이상 발생하지 않습니다.

, 그것은

The normal Fragment

가 무엇을 할 수있는 정상이된다 이것은 내가 두 번째 EditText

Messed Up Fragment

에 그리고 후 처음으로 클릭 할 때 무엇인가?

편집

제 2의 조각 레이아웃은 다음과 같습니다

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@color/white" 
android:clickable="true" 
android:fillViewport="true"> 

<RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_marginBottom="0dp" 
    tools:context="com.kayan.letsapp.Fragments.AddInviteeFragment" 
    android:background="@color/white" 
    android:clickable="true" > 


    <include android:id="@+id/header" 
     layout="@layout/event_header" /> 

    <com.kayan.letsapp.CustomComponents.GifView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="center" 
     android:id="@+id/loading_view"/> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/header" 
     android:layout_marginTop="@dimen/activity_vertical_margin" 
     android:layout_marginLeft="@dimen/activity_vertical_margin" 
     android:layout_marginRight="@dimen/activity_vertical_margin" 
     android:id="@+id/main" 
     android:background="@color/white" 
     android:visibility="gone"> 

     <com.kayan.letsapp.CustomComponents.CustomTextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="@string/invitee_form_title" 
      android:id="@+id/invitee_form_title" 
      android:textSize="@dimen/text_size_medium" 
      android:textColor="@color/grayLight" 
      android:layout_marginTop="@dimen/margin_small" 
      app:customFont="boldCondensed" /> 

     <com.kayan.letsapp.CustomComponents.CustomTextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/invitee_form_subtitle" 
      android:layout_below="@+id/invitee_form_title" 
      android:textSize="@dimen/text_size_small" 
      android:textColor="@color/grayLighter" 
      android:layout_marginTop="@dimen/activity_vertical_margin" 
      app:customFont="boldCondensed" /> 

     <com.kayan.letsapp.CustomComponents.CustomEditText 
      android:layout_marginTop="@dimen/activity_vertical_margin" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:inputType="textPersonName" 
      android:layout_below="@+id/invitee_form_subtitle" 
      android:hint="@string/name_input" 
      android:ems="10" 
      android:id="@+id/name_input" 
      android:background="@color/grayLightest" 
      android:textColorHint="@color/grayLight" 
      android:padding="10dp" 
      android:layout_weight="0.2"/> 

     <com.kayan.letsapp.CustomComponents.CustomEditText 
      android:layout_marginTop="@dimen/activity_vertical_margin" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/name_input" 
      android:inputType="textEmailAddress" 
      android:hint="@string/email_hint" 
      android:ems="10" 
      android:id="@+id/email_input" 
      android:background="@color/grayLightest" 
      android:textColorHint="@color/grayLight" 
      android:layout_weight="0.2" 
      android:padding="10dp"/> 

     <com.kayan.letsapp.CustomComponents.CustomButton 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/add_label" 
      android:layout_below="@+id/email_input" 
      android:id="@+id/add_invitee" 
      android:background="@drawable/primary_button" 
      android:textColor="@color/white" 
      android:layout_marginTop="@dimen/activity_vertical_margin" 
      android:layout_gravity="center_horizontal" 
      /> 

    </RelativeLayout> 

</RelativeLayout> 

그리고이 CustomEditText 클래스는 단지 잘 EditText

public class CustomEditText extends EditText{ 
private static final String TAG = "EditText"; 

public CustomEditText(Context context) { 
    super(context); 
} 

public CustomEditText(Context context, AttributeSet attrs) { 
    super(context, attrs); 
    setCustomFont(context, attrs); 
} 

public CustomEditText(Context context, AttributeSet attrs, int defStyle) { 
    super(context, attrs, defStyle); 
    setCustomFont(context, attrs); 
} 

private void setCustomFont(Context ctx, AttributeSet attrs) { 
    TypedArray a = ctx.obtainStyledAttributes(attrs, R.styleable.CustomEditText); 
    String customFont = a.getString(R.styleable.CustomEditText_customFont); 
    setCustomFont(ctx, customFont); 
    a.recycle(); 
} 


public boolean setCustomFont(Context ctx, String fontName) { 

    Typeface tf = FontHandler.getFont(fontName); 

    if (tf == null){ 
     setTypeface(FontHandler.getFont("regularCondensed")); 
    } 
    else { 
     setTypeface(tf); 
    } 

    return true; 
} 
+0

일부 코드/조각/수신기보기 –

+0

나는 내 질문을 편집, 미안합니다. 나는 청취자가 없다. –

+0

그 컨테이너에서 흰색 배경을 과장하고있는 것처럼 보입니다. 그것이 당신의 원인인지 확실하지 않지만, 나는 그것에 대해 살펴볼 것입니다. – wwfloyd

답변

1

에서 사용자 정의 글꼴을 설정하는 것입니다,나는 몇몇 편집 문맥을 가진 하나의 조각을 추가 할 때 똑같은 문제에 직면한다.

클릭하면 현재 조각이 투명 해집니다. 그래서 아래의 사용

  1. 가 추가 조각을 대체하기 위해 조각을 교체 사용 (하지만, 그것은 원인이 다시 스택 조각 새로 고침하지 않으려는)

  2. 는 배경에서와 클릭 추가 루트에

  3. 하나를 사용 글고 requestFocus를()에

그래서 보통 보면,하지만 내가 아는하지 않는 이유

+0

처음 두 단계를 수행하면 트릭을 수행합니다. –

관련 문제