2012-07-19 5 views
0

액티비티 클래스에서 애니메이션을 만들었습니다. 이제 레이아웃에서이 액티비티를 구현해야합니다. 새 액티비티 클래스를 열고 새로운 xml.then을 activity.But에서 레이아웃을 호출합니다.하지만 작동하지 않습니다. 레이아웃을 액티비티로 사용

은 main1.xml

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 
<com.frame.animation.FrameAnimationActivity 
    android:id="@+id/layout" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"/> 
</LinearLayout> 

그리고 활동 클래스

public class LaunchActivity extends Activity { 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main1); 
} 
} 

주 : 나는의 서브 클래스해야 AndroidManifest를

답변

0

레이아웃 파일의 각 항목에 활동을 추가 전망.

XML 파일에는 활동을 포함 할 수 없습니다.

코드를 View 또는 ViewGroup에서 상속하는 새 클래스로 옮깁니다.

+0

자세한 내용을 자세히 알려주십시오. – MBMJ

+0

레이아웃은 View 클래스로 구성됩니다. 활동에 레이아웃이 표시됩니다. – Brad

+0

그걸 알아.하지만 내가 알고 싶은 wud u 내 코드에서하십시오. – MBMJ

관련 문제