2017-11-30 3 views
0

작동하지 않습니다 ........ aaaand는 점 I에텍스트 뷰는 stackoverflow.com 그렇게 주장 때문에 더 필요하지 가짜 세부 사항을 추가하고

그래서 제 질문을 게시 거부 하지만 3 등 상자 요소를 구축하고 있습니까 :

<TextView/>을 추가하는 순간 레이아웃이 작동하지 않습니다 ... 왜 그렇습니까?

<TableLayout 
    android:layout_width="match_parent" 
    android:layout_height="74dp" 
    android:background="@color/sevenBlack" > 

    <TableRow 
     android:layout_height="match_parent" 
     android:weightSum="3"> 

     <View 
      android:layout_height="match_parent" 
      android:layout_weight="1"> 

      <!-- WTF!!! --> 
      <TextView android:text="Hello there"/> 

     </View> 

     <View 
      android:layout_height="match_parent" 
      android:layout_weight="1"></View> 

     <View 
      android:layout_height="match_parent" 
      android:layout_weight="1"></View> 
    </TableRow> 
</TableLayout> 

답변

1

당신은 보기의 내부에 다른 뷰 (TextView, EditTexts, Buttons)를 사용할 수 없습니다.

이 시도 :

<TableLayout 
    android:layout_width="match_parent" 
    android:layout_height="74dp" 
    android:background="@color/sevenBlack" > 

    <TableRow 
     android:layout_height="match_parent" 
     android:weightSum="3"> 

      <TextView android:text="Hello there"    
      android:layout_height="match_parent" 
      android:layout_weight="1"/> 

     <View 
      android:layout_height="match_parent" 
      android:layout_weight="1"></View> 

     <View 
      android:layout_height="match_parent" 
      android:layout_weight="1"></View> 
    </TableRow> 
</TableLayout> 

보기 상대 사용 선형 또는 기타 LayoutView에 더 많은 텍스트 뷰를 사용하려면

.

재미 있음

관련 문제