今天做了dialogfragment,程序码如下
<?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="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:orientation="vertical">
<EditText
android:id="@+id/account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="account"/>
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="password"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/login"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="login"/>
<Button
android:id="@+id/cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="cancel"/>
</LinearLayout>
</LinearLayout>
然後在activity中这样调用
val fm = supportFragmentManager
val dialog = FragmentDialog()
dialog.show(fm,"Blossom")
结果如下
但是在activity中架构会变得不好看,正在研究好的方式在viewmodel中呈现
>>: [Day22] 使用官方提供的工具,吸引用户不断回来使用Action
上次我们在mongo shell里使用mongodb aggregate 不过 我们需要在程序里面去...
昨天把骰子的程序逻辑都先完成了,这次我们将这个逻辑应用在 Android Studio 里。但我们今...
前面花了不少篇幅在讨论资料产品的开发,接下来将花一些篇幅讨论资料产品的治理方式。 在做资料产品治理时...
今天要介绍的工具是BIRDDIRB,是一个网页内容扫描器,它根据字典档一个个向目标网页发出请求,并分...
[Day2] CSS + JS Clock 运用 CSS 和 Javascript 做一个虚拟时钟 ...