0
我們有Android 3D旋轉木馬在這裏:http://www.codeproject.com/KB/android/androcarousel.aspx有人可以使用Android 3D Carousel的文本視圖嗎?
有我的問題是:我想使圖像和反射之間的文本標籤?
我該怎麼辦?
幫助我,請
我們有Android 3D旋轉木馬在這裏:http://www.codeproject.com/KB/android/androcarousel.aspx有人可以使用Android 3D Carousel的文本視圖嗎?
有我的問題是:我想使圖像和反射之間的文本標籤?
我該怎麼辦?
幫助我,請
我發現anwser:使用CarouselFrame
public class CarouselFrame extends FrameLayout implements Comparable<CarouselFrame> {
private int index;
private float currentAngle;
private float x;
private float y;
private float z;
private boolean drawn;
private ImageView image;
private TextView txt;
public CarouselFrame(Context context) {
this(context, null, 0);
}
public CarouselFrame(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CarouselFrame(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
image = new ImageView(context);
this.addView(image, new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
txt = new TextView(context);
this.addView(txt, new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
}
public void setImageBitmap(Bitmap img){
image.setImageBitmap(img);
}
public void setText(String text){
txt.setText(text);
}
public void setIndex(int index) {
this.index = index;
}
public int getIndex() {
return index;
}
public void setCurrentAngle(float currentAngle) {
this.currentAngle = currentAngle;
}
public float getCurrentAngle() {
return currentAngle;
}
public int compareTo(CarouselFrame another) {
return (int)(another.z - this.z);
}
public void setX(float x) {
this.x = x;
}
public float getX() {
return x;
}
public void setY(float y) {
this.y = y;
}
public float getY() {
return y;
}
public void setZ(float z) {
this.z = z;
}
public float getZ() {
return z;
}
public void setDrawn(boolean drawn) {
this.drawn = drawn;
}
public boolean isDrawn() {
return drawn;
}
}
它是有幫助對我來說太..但把圖像與多年平均值旋轉木馬出現在文本後屏幕中心..請告訴我在哪裏以及應該編輯什麼 – Shruti 2012-08-08 12:33:17