0

중첩 스크롤보기에서 recyclerview를 사용하고 있습니다. 그리고 recyclerview 아래에 두 개의 edittext를 button으로 배치해야합니다.recyclerview 아래의 편집 문구가 작동하지 않습니다.

하지만 문제는 Edittext가 포커스를 맞출 수 없다는 것입니다. (손가락을 대면 빨간색 커서 줄이 깜박이고 숨김) 편집 문구와 키보드도 표시 할 수 없습니다.

이것은 내 레이아웃입니다. 코드에서

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v4.widget.NestedScrollView 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:background="@color/colorWhite" 
    android:isScrollContainer="false" 
    android:paddingBottom="20dp"> 

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

     <!--Profile icon--> 
     <include layout="@layout/common_profile_layout" /> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="26dp" 
      android:background="@color/colorGrey"> 

      <TextView 
       android:id="@+id/count_id" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerVertical="true" 
       android:layout_marginLeft="24dp" 
       android:gravity="center" 
       android:text="Ringkasan Aktifitas" 
       android:textColor="?attr/colorUserGroup" /> 

      <Button 
       android:id="@+id/dafatar_filter" 
       android:layout_width="72dp" 
       android:layout_height="20dp" 
       android:layout_alignParentRight="true" 
       android:layout_centerHorizontal="true" 
       android:layout_centerVertical="true" 
       android:layout_marginRight="10dp" 
       android:background="@drawable/curve_corner_change_day" 
       android:clickable="true" 
       android:paddingLeft="5dp" 
       android:paddingRight="5dp" 
       android:text="Pilih Tanggal" 
       android:textAllCaps="false" 
       android:textColor="@android:color/white" 
       android:textSize="10sp" /> 
     </RelativeLayout> 

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

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="24dp" 
       android:text="06/13/2017" 
       android:textColor="@color/colorBlack" 
       android:textSize="@dimen/text_size_small" /> 
     </LinearLayout> 



     <android.support.v7.widget.RecyclerView 
       android:id="@+id/recycler_view" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="39dp" 
       android:background="@color/colorWhite" /> 


//the below edittext are not working. When i click the edittext, cursor blinks and keyboard is not displaying. 

    <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="10dp" 
      android:background="@color/edit_retailer_light_color" 
      android:orientation="vertical" 
      android:paddingBottom="10dp"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="21dp" 
       android:layout_marginTop="22dp" 
       android:text="Laporan Via" 
       android:textColor="@color/colorBlack" 
       android:textSize="14sp" /> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="13dp" 
       android:orientation="horizontal"> 

       <RelativeLayout 
        android:id="@+id/sms_rel" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content"> 

        <ImageView 
         android:id="@+id/sms_icon" 
         android:layout_width="20dp" 
         android:layout_height="20dp" 
         android:layout_alignParentLeft="true" 
         android:layout_marginLeft="32dp" 
         android:src="@drawable/ic_mark" /> 

        <TextView 
         android:id="@+id/sms_text" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_marginLeft="13dp" 
         android:layout_marginTop="3dp" 
         android:layout_toRightOf="@+id/sms_icon" 
         android:text="SMS" /> 

        <EditText 
         android:id="@+id/edtSms" 
         android:layout_width="222dp" 
         android:layout_height="28dp" 
         android:layout_marginLeft="19dp" 
         android:text="sfdsfdfffdssfdfdfsdfds" 
         android:layout_toRightOf="@+id/sms_text" 
         android:background="@drawable/edittext_border_curve" 
         android:focusable="true" 
         android:focusableInTouchMode="true" /> 
       </RelativeLayout> 

      </LinearLayout> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="10dp" 
       android:orientation="horizontal"> 

       <RelativeLayout 
        android:id="@+id/rel_1" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content"> 

        <ImageView 
         android:id="@+id/email_icon" 
         android:layout_width="20dp" 
         android:layout_height="20dp" 
         android:layout_alignParentLeft="true" 
         android:layout_marginLeft="32dp" 
         android:layout_marginTop="1dp" 
         android:src="@drawable/ic_mark" /> 

        <TextView 
         android:id="@+id/email_text" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_marginLeft="13dp" 
         android:layout_marginTop="3dp" 
         android:layout_toRightOf="@+id/email_icon" 
         android:text="Email" /> 

        <EditText 
         android:id="@+id/emailSms" 
         android:layout_width="222dp" 
         android:layout_height="28dp" 
         android:layout_marginLeft="15dp" 
         android:layout_toRightOf="@+id/email_text" 
         android:background="@drawable/edittext_border_curve" /> 
       </RelativeLayout> 
      </LinearLayout> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="15dp" 
       android:orientation="horizontal"> 

       <RelativeLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginLeft="15dp"> 

        <Button 
         android:layout_width="148dp" 
         android:layout_height="30dp" 
         android:layout_centerInParent="true" 
         android:background="@drawable/curve_corner" 
         android:gravity="center" 
         android:text="Kirim" 
         android:textAllCaps="false" 
         android:textColor="@color/colorWhite" 
         android:textSize="@dimen/text_size_small" /> 
       </RelativeLayout> 
      </LinearLayout> 
     </LinearLayout> 
    </LinearLayout> 
</android.support.v4.widget.NestedScrollView> 

,

난 그냥에만이 사용.

public class Activities extends Activity { 
    private RecyclerView recyclerView; 
    private SummaryAdapter adapter; 
    private EditText name; 
@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_summary_activities); 
    recyclerView = (RecyclerView) findViewById(R.id.recycler_view); 
    name= (EditText) findViewById(R.id.edtSms); 
    adapter = new ActivitiesSummaryAdapter(getData(), this); //list is working fine.. 
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, OrientationHelper.VERTICAL, false); 
    recyclerView.setLayoutManager(linearLayoutManager); 
    recyclerView.setNestedScrollingEnabled(false); 
    recyclerView.setAdapter(adapter); 
} 

편집 문구를 사용할 수 없습니다. 나는 실수하고있다. edittext에 키보드 또는 포커스가 표시되지 않습니다. 도와주세요.

+0

**'안드로이드 : windowSoftInputMode = "adjustResize"'** – Prem

+0

나는 매니페스트에이를 사용했다. 그래도 작동이 안되는. @Prem 키보드를 가져 오기 위해 edittext를 클릭 할 수 없습니다. – Walter

+0

* Android Manifest.xml *을 표시 할 수 있습니까? –

답변

0

귀하의 활동에 한 줄을 AndroidManifest.xml 개 파일로 입력하십시오. android:windowSoftInputMode="adjustResize|adjustPan"

+0

작동하지 않습니다. :-( – Walter

0

LinearLayout에서이 선을 제거해야합니다. 이것은 입력을하기 위해 edittext를 차단하는 것입니다.

안드로이드 : descendantFocusability = "blocksDescendants"

관련 문제