Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Android中创建登录表单?_Android - Fatal编程技术网

如何在Android中创建登录表单?

如何在Android中创建登录表单?,android,Android,我想创建一个登录表单。但我是android新手,所以我不能正确地完成它。我必须把公司的标志放在它的标题上。之后,标题将类似于登录到您的帐户,然后在一个框中输入用户名和密码。所以我正在发布我的xml,请更新它。谢谢 这是我如何从这个链接创建它请检查这个 用于在页眉中设置公司徽标: getActionBar().setHomeButtonEnabled(true); Drawable d=getResources().getDrawable(R.drawable.company_logo.png)

我想创建一个登录表单。但我是android新手,所以我不能正确地完成它。我必须把公司的标志放在它的标题上。之后,标题将类似于登录到您的帐户,然后在一个框中输入用户名和密码。所以我正在发布我的xml,请更新它。谢谢

这是我如何从这个链接创建它请检查这个


用于在页眉中设置公司徽标:

getActionBar().setHomeButtonEnabled(true);
Drawable d=getResources().getDrawable(R.drawable.company_logo.png);
getActionBar().setBackgroundDrawable(d);
用于设置标题:登录

getActionBar().setTitle("Login");

希望对您有所帮助。

在页眉中设置公司徽标:

getActionBar().setHomeButtonEnabled(true);
Drawable d=getResources().getDrawable(R.drawable.company_logo.png);
getActionBar().setBackgroundDrawable(d);
after 1st LinearLayout (root) you can write these lines:

<RelativeLayout
        android:id="@+id/headerLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="top" >

        <View
            android:id="@+id/headerView"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:layout_alignParentTop="true"
            android:background="@drawable/Your-header-file-name" />
</RelativeLayout
用于设置标题:登录

getActionBar().setTitle("Login");
我希望它能对您有所帮助。

在第一行线性布局(root)之后,您可以编写以下行:
after 1st LinearLayout (root) you can write these lines:

<RelativeLayout
        android:id="@+id/headerLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="top" >

        <View
            android:id="@+id/headerView"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:layout_alignParentTop="true"
            android:background="@drawable/Your-header-file-name" />
</RelativeLayout
在第一行线性布局(根)之后,您可以编写以下行:

我创建了一个示例代码。您需要用示例图像替换正确的图像

布局代码

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ImageView
    android:id="@+id/imgLogo"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:src="@drawable/ic_launcher" />

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="250dp"
    android:layout_below="@+id/imgLogo"
    android:background="#092EA1"
    android:orientation="vertical"
    android:paddingBottom="10dp"
    android:paddingLeft="10dp"
    android:paddingRight="10dp" >

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:layout_marginTop="10dp"
        android:gravity="center_horizontal"
        android:text="Login to Your Account"
        android:textColor="@android:color/white"
        android:textSize="25sp" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/white" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="260dp"
            android:layout_height="40dp"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="17dp"
            android:layout_marginTop="15dp"
            android:background="@android:color/darker_gray" />

        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imageView1"
            android:layout_alignLeft="@+id/imageView1"
            android:layout_alignRight="@+id/imageView1"
            android:layout_alignTop="@+id/imageView1"
            android:layout_marginLeft="40dp"
            android:hint="Usrname" />

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="260dp"
            android:layout_height="40dp"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/imageView1"
            android:layout_marginLeft="17dp"
            android:layout_marginTop="15dp"
            android:background="@android:color/darker_gray" />

        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imageView2"
            android:layout_alignLeft="@+id/imageView2"
            android:layout_alignRight="@+id/imageView2"
            android:layout_alignTop="@+id/imageView2"
            android:layout_marginLeft="40dp"
            android:hint="Password"
            android:inputType="textWebPassword" />

        <ImageView
            android:id="@+id/imageView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/imageView2"
            android:layout_below="@+id/imageView2"
            android:layout_marginTop="26dp"
            android:src="@drawable/ic_launcher" />

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imageView3"
            android:layout_alignRight="@+id/imageView2"
            android:text="Forget Password?"
            android:textAppearance="?android:attr/textAppearanceLarge" />
    </RelativeLayout>
</LinearLayout>
</RelativeLayout>

这看起来像,


我创建了一个示例代码。您需要用示例图像替换正确的图像

布局代码

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ImageView
    android:id="@+id/imgLogo"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:src="@drawable/ic_launcher" />

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="250dp"
    android:layout_below="@+id/imgLogo"
    android:background="#092EA1"
    android:orientation="vertical"
    android:paddingBottom="10dp"
    android:paddingLeft="10dp"
    android:paddingRight="10dp" >

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:layout_marginTop="10dp"
        android:gravity="center_horizontal"
        android:text="Login to Your Account"
        android:textColor="@android:color/white"
        android:textSize="25sp" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/white" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="260dp"
            android:layout_height="40dp"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="17dp"
            android:layout_marginTop="15dp"
            android:background="@android:color/darker_gray" />

        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imageView1"
            android:layout_alignLeft="@+id/imageView1"
            android:layout_alignRight="@+id/imageView1"
            android:layout_alignTop="@+id/imageView1"
            android:layout_marginLeft="40dp"
            android:hint="Usrname" />

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="260dp"
            android:layout_height="40dp"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/imageView1"
            android:layout_marginLeft="17dp"
            android:layout_marginTop="15dp"
            android:background="@android:color/darker_gray" />

        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imageView2"
            android:layout_alignLeft="@+id/imageView2"
            android:layout_alignRight="@+id/imageView2"
            android:layout_alignTop="@+id/imageView2"
            android:layout_marginLeft="40dp"
            android:hint="Password"
            android:inputType="textWebPassword" />

        <ImageView
            android:id="@+id/imageView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/imageView2"
            android:layout_below="@+id/imageView2"
            android:layout_marginTop="26dp"
            android:src="@drawable/ic_launcher" />

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imageView3"
            android:layout_alignRight="@+id/imageView2"
            android:text="Forget Password?"
            android:textAppearance="?android:attr/textAppearanceLarge" />
    </RelativeLayout>
</LinearLayout>
</RelativeLayout>

这看起来像,



您可以将
ImageView
放入使用徽标和使用“inputtype=password”在编辑文本中。附加您需要的GUIWant@KaranMavadhiya我没有发布图片的名声。如果你能给我你的id,这样我就可以给你发邮件,然后你就可以在stackoverflow上发布xml。我将永远感谢你。你可以上传到免费门户网站,并在这里引用我的朋友。在谷歌上传图片,给我那个链接。我将尝试解决它您可以将
ImageView
用于使用徽标并使用“inputtype=password”在编辑文本中。附加您需要的GUIWant@KaranMavadhiya我没有发布图片的名声。如果你能给我你的id,这样我就可以给你发邮件,然后你就可以在stackoverflow上发布xml。我将永远感谢你。你可以上传到免费门户网站,并在这里引用我的朋友。在谷歌上传图片,给我那个链接。我将尝试解决ItI。我已经发布了图像链接,该链接将定义我必须如何制作。因此,根据图像,请建议我XML文件中的更改,感谢您的帮助。等待您的答复。我已经发布了图像链接,该链接将定义我必须如何制作。因此,根据图像,请建议我XML文件中的更改,感谢您的帮助帮助。等待您的回复>我已经发布了该图像,请建议我如何为该图像创建xml,我没有收到您的评论。请告诉我我还能为您做些什么?我已经给了您在操作栏中设置徽标的代码,但在查看您上传的图像后,您似乎正在寻找imageview。对于它,您可以简单地添加一个imageview并为其设置资源。对于您的信息,您的设计看起来像一个网站设计,但在移动应用程序设计的情况下会有很大的不同,例如:不需要登录按钮等>我已经发布了该图像,请建议我对应于该图像如何创建xml,我没有收到您的评论。请告诉我我还能为您做些什么?我已经给了您在操作栏中设置徽标的代码,但在查看您上传的图像后,您似乎正在寻找imageview。对于它,你可以简单地添加一个imageview并为其设置资源。对于你的信息,你的设计看起来像一个网站设计,但在移动应用程序设计的情况下会有很大的不同,例如:不需要登录按钮等。非常感谢它为我工作了很多非常感谢你。我非常紧张,但我得到了我的解决方案,非常感谢你。安卓系统中是否有可供设计的工具?很高兴能帮助你……
安卓系统中是否有可供设计的工具
。对它的
实践
。通过一个月的技术开发,您将能够解决问题。:)我刚刚开始开发,谢谢你能提供我你的个人邮件id吗?这样,如果我有任何问题,我可以接受你的帮助,你可以在我的个人资料中看到。:)好的,我已经在我的google plus中添加了你。我正在完成你的博客,对我们来说很好,继续…一切都好,谢谢你的帮助。谢谢你对我的帮助。非常感谢。我非常紧张,但我得到了我的解决方案,非常感谢你。安卓系统中是否有可供设计的工具?很高兴能帮助你……
安卓系统中是否有可供设计的工具
。对它的
实践
。通过一个月的技术开发,您将能够解决问题。:)我刚刚开始开发,谢谢你能提供我你的个人邮件id吗?这样,如果我有任何问题,我可以接受你的帮助,你可以在我的个人资料中看到。:)好的,我已经在我的google plus中添加了你。我正在完成你的博客,对我们来说很好,继续前进……祝你一切顺利,谢谢你的帮助