You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
4.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

drawable放图片
图片后缀0表示未选中状态1表示选中状态
layout放页面
index首页
find发现
message消息
my我的
record:录音
线性布局:
<LinearLayout
android:orientation="vertical"/>
app主题
android:theme="@style/Theme.AppCompat.Light.NoActionBar" >
app名字音之轨迹
wrap_content布局元素将根据内容改变大小
fill_parent 宽度或者高度布满整个屏幕
match_parent强制性使它的大小等于父控件整个屏幕
colors.xml颜色
string.xml:文本内容
styles.xml:外部样式
修改Android app图标(Android Studio)
1. @res\drawable 放置icon.png(此图片是你需要修改的图标);
2.修改AndroidManifest.xml @android:icon="@drawable/icon"
3. 编译运行即可。
横线(horizontal line)
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@android:color/white"/>
竖线(vertical line)
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="@android:color/white"/>
改背景图:
.在activity_main.xml里添加下面一句注意添加位置/drawable/+图片名称。
android:background="@drawable/backimg"
整个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:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
android:paddingBottom="0dp" tools:context=".MainActivity"
android:background="@drawable/backimg"
>
<TextView
android:text="hello,world!"
android:textSize="50dp"
android:textColor="#FFFFFF"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</RelativeLayout>
Activity
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
登录界面的标题:
<TextView
style="@style/textstyle"
android:layout_height="47dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:gravity="center"
android:text="@string/login"
android:textColor="#62b9b3"
android:textSize="15sp"
app:layout_constraintBottom_toTopOf="@+id/editPhone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
tools:ignore="MissingConstraints" />
注册界面:
<TextView
android:id="@+id/tvShowDialog"
android:layout_width="173dp"
android:layout_height="33dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:gravity="center"
android:text="出生年月日"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editPwd" />
<TableRow
android:id="@+id/tableRow"
android:layout_width="282dp"
android:layout_height="38dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.636"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvShowDialog">
<TextView
android:layout_width="91dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:text="性别:" />
</TableRow>
<RadioGroup
android:id="@+id/rg"
android:layout_gravity="center_horizontal"
android:orientation="horizontal">
<RadioButton
android:id="@+id/male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="男" />
<RadioButton
android:id="@+id/famle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="女" />
</RadioGroup>