Я начинаю программировать в андроиде. Я пытаюсь добавить ряд кнопок над моей MapFragment согласно компоновщика ниже:Добавление кнопок над mapfragment
<?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" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tilt"
android:onClick="tilt" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Move"
android:onClick="move"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/mymap">
</LinearLayout>
</LinearLayout>
public class MainActivity extends Activity
{
GoogleMap gm;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.finallay);
MapFragment mp=new MapFragment();
getFragmentManager().beginTransaction().add(R.id.mymap,mp).commit();
}
}
Однако полученный вид не показывает карту, а только buttons.am я сделать некоторые ошибка здесь. Без добавления кнопок тег фрагмента работает нормально. спасибо