2
XML에서 오는 사용자 정의보기를 원합니다.xml에서 사용자 정의보기 만들기
여기 내 XML의 :
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/movieTitle"
android:text="@string/movietitle"
android:textSize="35dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
/>
<com.galite.headliner.views.LoaderImageView
android:id="@+id/moviePoster"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/movieTitle"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:contentDescription="@string/poster"
/>
<TextView
android:id="@+id/movieDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/description"
android:layout_below="@id/moviePoster"
android:gravity="center"
/>
</RelativeLayout>
그리고 난 내가 온 클릭하고 모든 것을 같은 방법을 사용해야하기 때문에 사용자 정의보기로 팽창합니다.
여기 내 생성자의 :
public MyView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
this.context = context;
initializeView();
}
public void initializeView(){
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = inflater.inflate(R.layout.movie, null);
}
가 어떻게 V에 MYVIEW 동일 할 수 ?
LayoutInflater 형식의 inflate (int, ViewGroup, boolean) 메서드가 인수 (int, MovieView, boolean)에 적용되지 않습니다. – Tsunaze
@Tsunaze 죄송합니다. 답을 수정했습니다. – Luksprog