-3

我无法在显示屏上看到我的TextView。我把的LinearLayout和TextView的在RelativeLayout的,但只有LinearLayout中可以看出,而不是TextView的TextView在Android Studio的RelativeLayout中不起作用

请帮我这个代码。在此先感谢

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_height="match_parent" 
    android:layout_width="match_parent" 
    > 

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     tools:context="com.example.dakshesh.happybirthday.MainActivity"> 

     <ImageView 
      android:src="@mipmap/ic_launcher" 
      android:layout_height="0dp" 
      android:layout_width="match_parent" 
      android:layout_weight="1" 
      android:scaleType="centerCrop" 
      /> 

     <ImageView 
      android:src="@mipmap/ic_launcher" 
      android:layout_height="0dp" 
      android:layout_width="match_parent" 
      android:layout_weight="1" 
      android:scaleType="centerCrop" 
      /> 

     <ImageView 
      android:src="@mipmap/ic_launcher" 
      android:layout_height="0dp" 
      android:layout_width="match_parent" 
      android:layout_weight="1" 
      android:scaleType="centerCrop" 
      /> 

    </LinearLayout> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:padding="16sp" 
     android:textStyle="bold" 
     android:textSize="20dp" 
     android:text="Bahubali" 
     /> 

</RelativeLayout> 
+2

如果你想显示的'TextView'?在视图的顶部或视图的底部?请详细说明。 –

+4

请粘贴您的代码,而不是包含链接。 – jlively

+0

使用'ScrollView'来获取'TextView' –

回答

-1

它因为你没有把你的textview下面linearlayout。 所以textview重叠在linearlayout上,这就是为什么你不能看到它。 只要给id来的LinearLayout

android:id="@+id/linear" 

写里面的TextView此行..

android:layout_below="linear" 
+0

你明白这个问题吗?它的Linearlayout是采取整个空间不textview.So放置在线性布局下面的textview将没有影响。即使textview将不可见 –

+0

确定然后linearlayout高度应该是wrap_content – kkk

+0

为什么不使用下面的textView? –

相关问题