2017-10-04 12 views
-3

基本レイアウトとして制約レイアウトのアンドロイドアプリケーションを作成し、それを相対レイアウトに変換したいとします。レイアウト内のアイテムに影響を与えずに、どうすればいいですか?制約レイアウトを相対レイアウトに変換する方法

<android.support.constraint.ConstraintLayout 
    xmlns:android="schemas.android.com/apk/res/android" 
    xmlns:app="schemas.android.com/apk/res-auto" 
    xmlns:tools="schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.example.android.intent_basics.MainActivit‌​y"> 
+0

独自のコードを生成することよりも、それが私たちのためにデバッグする方が簡単です、あなたのコードを表示します。 – F0XS

+0

joshua

+1

コメントではなく**あなたの質問に**コードを追加してください。 –

答えて

0

あなたの質問に投稿した内容から、制約レイアウトには子ビューがないようです。その場合は、単純に置き換える:

<android.support.constraint.ConstraintLayout 
    xmlns:android="schemas.android.com/apk/res/android" 
    xmlns:app="schemas.android.com/apk/res-auto" 
    xmlns:tools="schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.example.android.intent_basics.MainActivit‌​y"> 

    ... 

</android.support.constraint.ConstraintLayout> 

をして:

<RelativeLayout 
    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" 
    tools:context="com.example.android.intent_basics.MainActivit‌​y"> 

    ... 

</RelativeLayout> 
関連する問題