2016-09-29 23 views
0

我儘量讓這個版權帶在我的接口的接口一個TextView:地方使用Android

enter image description here

這是我的佈局:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/mainbg" 
    android:layout_marginTop="0dp" 
    android:scaleType="fitXY" 
    android:clickable="false" 
    android:contentDescription="News " 
    > 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="300dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentTop="true" 
     android:layout_centerHorizontal="true" 
     android:background="@color/Transparent" 
     android:gravity="fill" > 

     <ProgressBar 
      android:id="@+id/progressBarsplash" 
      android:indeterminate   = "true" 
      android:layout_width   = "wrap_content" 
      android:layout_height   = "wrap_content" 
      android:layout_marginTop  = "5dp" 
      android:layout_marginBottom  = "5dp" 
      android:layout_alignParentLeft = "true" 
      android:indeterminateDrawable = "@layout/customprogressbar"/> 

     <com.ofss.fcdb.mobile.android.tablet.ui.components.FCImageView 
      android:id="@+id/imageView1" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_alignParentTop="true" 
      android:layout_centerHorizontal="true" 
      android:layout_marginTop="0dp" 
      android:scaleType="fitXY" 
      android:src="@drawable/oraclelogosplash" /> 

    </RelativeLayout> 

<!--  this is my textview for copyright --> 
     <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="30dp" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true" 
     android:gravity="center_vertical" 
     android:orientation="horizontal" 
     android:background="#fcfcfc" 
     android:paddingBottom="50dp"> 


     <ImageView 
      android:layout_width="25dp" 
      android:layout_height="25dp" 
      android:layout_marginTop="0dp" 
      android:src="@drawable/securelogin" 
      android:layout_gravity="center" 
      /> 


      <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/K_COPYRIGHT" 
      android:textColor="@color/Black" 
      android:textSize="16dp" 
      android:paddingLeft="5dp" 
      android:gravity="center"/> 


    </LinearLayout> 

</RelativeLayout> 

我與Android平板電腦工作,這是我得到的:

enter image description here

TextView的顯示在頁面的底部或我希望它像第一頁,我的代碼的文本不顯示:( 我在安卓 業餘的任何幫助,請 感謝您的幫助

更新:

感謝莫希特特里維迪的回答,這是我得到的結果:

enter image description here

是有可能把圖像中像文中心,這是行不通的與

android:layout_gravity="center" 

感謝您的幫助

回答

1
<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_marginTop="0dp" 
    android:background="@drawable/mainbg" 
    android:clickable="false" 
    android:contentDescription="News " 
    android:scaleType="fitXY"> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="300dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentTop="true" 
     android:layout_centerHorizontal="true" 
     android:background="@color/Transparent" 
     android:gravity="fill"> 

     <ProgressBar 
      android:id="@+id/progressBarsplash" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_marginBottom="5dp" 
      android:layout_marginTop="5dp" 
      android:indeterminate="true" 
      android:indeterminateDrawable="@layout/customprogressbar" /> 

     <com.ofss.fcdb.mobile.android.tablet.ui.components.FCImageView 
      android:id="@+id/imageView1" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_alignParentTop="true" 
      android:layout_centerHorizontal="true" 
      android:layout_marginTop="0dp" 
      android:scaleType="fitXY" 
      android:src="@drawable/oraclelogosplash" /> 

    </RelativeLayout> 

    <!--  this is my textview for copyright --> 
    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="30dp" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true" 
     android:layout_marginBottom="20dp" 
     android:background="#fcfcfc" 
     android:gravity="center" 
     android:orientation="horizontal"> 


     <ImageView 
      android:layout_width="25dp" 
      android:layout_height="25dp" 
      android:layout_gravity="center" 
      android:layout_marginTop="0dp" 
      android:src="@drawable/securelogin" /> 


     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:paddingLeft="5dp" 
      android:drawableLeft="@drawable/securelogin" 
      android:text="@string/K_COPYRIGHT" 
      android:textColor="@color/Black" 
      android:textSize="16dp" /> 


    </LinearLayout> 

</RelativeLayout> 

替換上面的代碼你的佈局,將工作

+0

是的,先生感謝它的工作 – user3821206

+1

@ user3821206歡迎您,如果您滿意,請接受答案 –

+0

我還有其他問題先生,我該如何將安全圖標放入中心,我把它放在版權樂隊的左邊部分和中心的文字 – user3821206

1

這是佈局的底部的方向/重力問題的小問題。只需將center_vertical更改爲中心,即可得出確切結果

+0

感謝Sir Patrick先生的回覆:) – user3821206