直播软件app开发,用户自定义头像选择
1.进行主界面的布局activity_main.xml
<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:orientation="horizontal"
tools:context=".MainActivity" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/ic_launcher" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageButton1"
android:layout_marginLeft="18dp"
android:layout_toRightOf="@+id/imageButton1"
android:ems="10" >
<requestFocus />
</EditText>
</RelativeLayout>
2.进行对话框中组件的布局activity_show_gallery.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageSwitcher
android:id="@+id/imageSwitcher1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true">
</ImageSwitcher>
<Gallery
android:id="@+id/gallery1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="?android:galleryItemBackground"
android:gravity="center_vertical"
android:spacing="3dp"
/>
</RelativeLayout>
以上就是 直播软件app开发,用户自定义头像选择,更多内容欢迎关注之后的文章
标签:layout,自定义,app,height,content,头像,wrap,android,id From: https://www.cnblogs.com/yunbaomengnan/p/17349361.html