Ich m noob zu Android, ich habe eine einfache Frage. Ich habe TextView in einem RelativeLayout, ich möchte dynamisch unterhalb der TextView eine Schaltfläche hinzufügen, die in einem RelativeLayout, vorhanden ist, wie kann ich das tun? danke!machen Knöpfe in android mit JAVA-Klassen
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@mipmap/background"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/container">
<android.support.v4.view.ViewPager
android:id="@+id/screen3"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
>
</android.support.v4.view.ViewPager>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:paddingTop="30dp"
android:id="@+id/act3_txt1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="35sp"
android:textAlignment="center"
android:textColor="#FFFFFF"
/>
<ImageView
android:paddingTop="30dp"
android:id="@+id/cam_images"
android:layout_height="250sp"
android:layout_width="wrap_content"
android:layout_below="@+id/act3_txt1" />
<TextView
android:paddingTop="30dp"
android:id="@+id/act3_txt2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/cam_images"
android:textSize="35sp"
android:textAlignment="center"
android:layout_centerInParent="true"
android:textColor="#FFFFFF"
android:paddingBottom="20dp"/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
bitte etwas Quellcode bereitstellen zu setzen. –
Ihre Frage zeigt null Forschung und Null Anstrengung, um das Problem auf eigene Faust zu lösen, bitte versuchen Sie dies zuerst und kommen Sie zurück, wenn Sie ein bestimmtes Problem haben. – Egor
@Egor Bitte beachten Sie den Kommentar unten Ich versuche ... Es tut mir leid, ich konnte den Code in der Post nicht veröffentlichen. Ich bin auch auf StackOverFlow! –