2017-02-03 6 views
1

안드로이드 어댑터 같은 질문 (빈칸을 채워)에 대한 레이아웃을 배치하는 방법 :내가 <strong>텍스트 뷰</strong>, <strong>글고</strong> 아래 같은 다른 질문 목록보기 용 어댑터에 <strong>텍스트 뷰</strong> 팽창하고

무엇 귀하의 이름은 ______입니다. tajmahal은 _______ 국가에 있습니다. ________은 사과입니다.

<HorizontalScrollView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:fillViewport="true"> 

    <LinearLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:fitsSystemWindows="true" 
     android:orientation="horizontal"> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/newtextview" 
      android:gravity="center" 
      android:padding="5dp" 
      android:textColor="@color/black"/> 

     <EditText 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/blank_set" 
      android:ems="3" 
      android:padding="5dp" 
      android:inputType="text" 
      android:textColor="@color/black"/> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:textColor="@color/black" 
      android:padding="5dp" 
      android:id="@+id/textQuestiontwo"/> 

    </LinearLayout> 

</HorizontalScrollView> 

하지만하지을 목록보기에서 항목 수평을 스크롤 할 수 있습니다. 물론 코멘트를 만들면 가로 스크롤보기 textviews 일부 문자 ommiting 있습니다. 사전

답변

1

에서

덕분에이

당신은 수평으로 특정 레이아웃 컨트롤 (글고, 버튼 등)의 특정 수를 준비해야하고 아래에 컨트롤을 갖는 동일한 레이아웃을 추가하고, 간단하지 않다 등등 ...

1.

당신은 수평 방향으로 여러있는 LinearLayout를 사용할 필요가

순서에 따라 필요한 항목을 추가하십시오 (너비에 따라 항목 너비를 관리 할 수 ​​있습니다).

원하는 화면 해상도를 다루고 있는지 확인하십시오.

동일한 방식으로 구현할 수 있지만 시간이 많이 소요되지만 사용 가능한 장치 너비를 계산 한 다음 필요한 항목을 레이아웃에 동적으로 추가해야하지만 권장하지는 않습니다.

+0

이 대안이 있습니다. –