2016-12-11 1 views
1

Code ist unten angegeben: Textansichten "Current Location" und "User Address" nicht auf dem Anwendungsbildschirm sichtbar, wenn ich auf meinem Gerät.Während im Entwurfsmodus sind sichtbar . Mein Layoutcode ist: Textansicht wird nicht im Anwendungsbildschirm angezeigt (Android)

<RelativeLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:paddingTop="@dimen/_40dp" 
     android:paddingLeft="@dimen/_10dp" 
     android:paddingRight="@dimen/_10dp"             
     android:background="@color/colorPrimary" 
     android:paddingBottom="@dimen/_40dp" 
     > 
      <TextView 
       android:layout_width="fill_parent" android:id="@+id/current" 
       android:layout_height="wrap_content" android:layout_marginLeft="@dimen/_30dp" 
       android:textSize="15dp" android:textColor="@color/background" 
       tools:text="Current Location" /> 

      <TextView 
       android:layout_width="fill_parent" android:id="@+id/user_current_addr" android:layout_marginTop="@dimen/_10dp" 
       android:layout_height="wrap_content" android:layout_marginLeft="@dimen/_30dp" 
       android:layout_centerVertical="true" android:layout_below="@+id/current" 
       android:textSize="20dp" android:textColor="@color/background" 
       tools:text="User Address" /> 

    </RelativeLayout> 
    <FrameLayout 
     android:id="@+id/child_fragment_container" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" android:background="@color/background" 
     android:layout_weight="1" /> 
</LinearLayout> 

Fragment-Code

public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle savedInstanceState) 
{ 
// Inflate the layout for this fragment 
View view = inflater.inflate(R.layout.fragment_my_location, container, false); 
return view; 
} 

ist und der Bildschirm ist: Layout Screen

+0

Lassen Sie uns [diese Diskussion im Chat fortsetzen] (http://chat.stackoverflow.com/rooms/130348/discussion-between-umair-iqbal-and-opiatefuchs). –

Antwort

3

Base auf Ihren Code, Sie vermissen die Zeichenfolge Ihre Textviews einstellen wollen Verwenden Sie (android:text). Im Moment verwenden Sie nur tools:text="Current Location", die nur einen Text in der Vorschau anzeigen.

+0

verdammt .... das ist richtig ..... manchmal frage ich mich, warum ich sowas übersehen :) ..props eagle-benny – Opiatefuchs

+0

@Opiatefuchs, Ja Absolut richtig. –

+0

virtuelle Ohrfeige .....: O) – Opiatefuchs

Verwandte Themen