Merhaba Şu an yüzey görünümünde arka planda ses frekansı efektinin görselleştirmesini içeren Oyun üzerinde çalışıyorum.Görünümü yüzey için arka plan olarak nasıl eklenir?
The surfaceView contains actual game play.
Bazı kod parçacıklarını gönderme: -
main.xml
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="#000" >
<co.ardor.visualizer.VisualizerView
android:id="@+id/visualizerView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</co.ardor.visualizer.VisualizerView>
</FrameLayout>
Visualizer view
oluşturulur
public class VisualizerView extends View
{
private static final String TAG = "VisualizerView";
private byte[] mBytes;
private byte[] mFFTBytes;
private Rect mRect = new Rect();
private Visualizer mVisualizer;
private Set<Renderer> mRenderers; // type of Renderer class
private Paint mFlashPaint = new Paint(); // for flash paint
private Paint mFadePaint = new Paint(); // for fade paint
public VisualizerView(Context context, AttributeSet attrs, int defStyle)
{
super(context, attrs);
init();
}
public VisualizerView(Context context, AttributeSet attrs)
{
this(context, attrs, 0);
}
public VisualizerView(Context context)
{
this(context, null, 0);
}
// Some code regarding to the audio visualization..
}
Ben SurfaceView (Gerçek koşu Oyunu) için arka plan olarak bu ekleyebilir ne kadar iyi bu yüzden çalışan My VisualizerView .Ben sorun şaşırıp bunun için "How to add VIEW as background of surfaceView?"
Veya herhangi başka daha iyi bir çözüm olduğunu .. peşin Thx ..
Görüntüleme arka plan olarak eklenemez. Aktivitenizin içerik görünümü olarak ayarlamanız gerekiyor – Blackbelt