2017-10-17 15 views
-1

こんにちは私はAndroid開発を始めています。 Android Studioでオープンソースのサンプルを修正しています。同じRelativeLayoutの兄弟ではありませんか?

私はstring.xmlといくつかの.pngファイルのみを変更しました。 Androidのシミュレータでは完璧に動作しますが、署名付きApkファイルを生成しようとすると、同様の記述で2つのエラーが発生します。

これは(行は*でマーキングされた)そのうちの一つである:android:id="@+id/sticker_framelayout"

Error:(33) Error: @id/linear_adview is not a sibling in the same RelativeLayout [Not Sibling]

+0

から –

+0

あなたが「削除する必要があなたのxmlレイアウトのすべての – nhoxbypass

+0

ファーストを提供してください+ 」から android:layout_above = "@ + id/linear_adview" To android:layout_above = "@ id/linear_adview" –

答えて

0
<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:ads="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/rl_content_root" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/background"> 
<LinearLayout`enter code here` 
     android:id="@+id/linear_adview" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical"> 
     <com.google.android.gms.ads.AdView 
      android:id="@+id/ad_view_editimg" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      ads:adSize="BANNER" 

<RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_above="@+id/sticker_recycler_view" 
      android:layout_below="@id/linear_adview"> 

      <FrameLayout 
       android:id="@+id/sticker_framelayout" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_below="@id/linear_adview"> 


       <ImageView 
        android:id="@+id/pic_edit_imageview" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:padding="5dp" 
        android:scaleType="centerCrop" 
        android:src="@drawable/background" 

        /> 

       <include 
        layout="@layout/text_layout" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" /> 

      </FrameLayout> 


     </RelativeLayout> 
    </LinearLayout> 
    <android.support.v7.widget.RecyclerView 
      android:id="@+id/sticker_recycler_view" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:padding="5dp" 
      android:visibility="visible" 
      android:layout_above="@+id/linearLayout" /> 

    <LinearLayout 
     android:id="@+id/linearLayout" 
     android:layout_width="match_parent" 
     android:layout_height="50dp" 
     android:layout_alignParentBottom="true" 
     android:background="@color/colorPrimary" 
     android:orientation="horizontal"> 

     <TextView 
      android:id="@+id/smoke_tv" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_gravity="center_vertical" 
      android:layout_weight="1" 
      android:clickable="true" 
      android:background="@color/black" 
      android:gravity="center" 
      android:text="@string/smoke" 
      android:textColor="@color/white" 
      android:textSize="18sp" /> 

     <TextView 
      android:id="@+id/text_tv" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_gravity="center_vertical" 
      android:layout_weight="1" 
      android:clickable="true" 
      android:gravity="center" 
      android:text="@string/text" 
      android:textColor="@color/white" 
      android:textSize="18sp" /> 

     <TextView 
      android:id="@+id/share_tv" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_gravity="center_vertical" 
      android:layout_weight="1" 
      android:gravity="center" 
      android:clickable="true" 
      android:text="@string/share" 
      android:textColor="@color/white" 
      android:textSize="18sp" /> 
    </LinearLayout> 
</RelativeLayout>` 
` 
0

でframeLayoutはandroid:id="@+id/linear_adview"とのLinearLayoutの直接の兄弟ではなく、あなたがandroid:layout_below="@id/linear_adview"を使用できない理由ですその中に。実際に使用すると、1つのビューにRelativeLayoutとでframeLayoutをマージすることができますの.xmlファイルを共有してください

<RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_above="@+id/sticker_recycler_view" 
     android:layout_below="@id/linear_adview"> 

     <FrameLayout 
      android:id="@+id/sticker_framelayout" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_below="@id/linear_adview"> 

(...) 

     </FrameLayout> 

<FrameLayout 
      android:id="@+id/sticker_framelayout" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_above="@+id/sticker_recycler_view" 
      android:layout_below="@id/linear_adview"> 

(...) 

</FrameLayout> 
関連する問題