我正在尝试获取Android应用程序的登录屏幕,到目前为止这是我的代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:inputType="text"
android:singleLine="true"
android:imeOptions="actionNext">
<requestFocus />
</EditText>
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="textPassword"
android:singleLine="true"
android:imeOptions="actionDone" />
<Button
android:id="@+id/buttonLaunchTriage"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="@string/login" />
</LinearLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
当我尝试运行它时,键盘显示正确的键,但是当我在输入密码后尝试按完后,没有任何反应.我用它来处理按钮按下:
private void setupLoginButton() {
Button launchButton = (Button) findViewById(R.id.buttonLaunchTriage);
launchButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EditText username = (EditText) findViewById(R.id.patient_start_userName_value);
EditText password = (EditText) findViewById(R.id.patient_start_password_value);
try {
if(TriageApplicationMain.validateUser(username.getText().toString(),password.getText().toString(),getApplicationContext()))
{
Toast.makeText(StartActivity.this,
"Launching Triage Application", Toast.LENGTH_SHORT)
.show();
startActivity(new …Run Code Online (Sandbox Code Playgroud) 我正在尝试以编程方式将从HTML文件中选取的表单字段添加到LinearLayout.我在底部有一个下一个按钮,但它在显示屏上不断切断.我在平板电脑上尝试过,它仍然没有显示出来.
正如您所看到的,元素正在渲染,但最后一个元素由于某种原因而在屏幕上运行.
片段的XML:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".dataInput.PropertyInfoFragment"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<ScrollView
android:fillViewport="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/linear_layout_property_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
<Button
android:id="@+id/nextButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/next"
android:background="@color/colorPrimary"
android:textColor="@android:color/white"/>
</LinearLayout>
</ScrollView>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)
调用Activity的XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".dataInput.DataInputActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin" …Run Code Online (Sandbox Code Playgroud) android android-linearlayout android-fragments android-scrollview
我分叉了一个 npm 包(https://github.com/spark/particle-api-js),做了一些改变,在一个项目中使用了它(https://github.com/RoomKit/RoomKit-Backend)然后离开了它一会儿。
我今天继续研究它,突然节点声称未安装该软件包。如果我用版本号替换 package.json 中的自定义存储库,它就可以正常工作。在这两种情况下,包都在 node_modules 文件夹中。
我删除了 node_modules 文件夹并运行了npm install. 这没有问题,但在运行时它仍然抱怨。到底是怎么回事?
因此,我正在学习Django,而不是尝试在Windows上进行所有设置,而是设置了Ubuntu 14.04 Server VM并在此处进行了设置。我已将网络模式设置为桥接。我能够通过SSH进入虚拟机,并且一切正常。我遵循了该指南:https : //github.com/makrandgupta/pyladies-django-workshop并能够完成安装过程。我运行最终命令,程序告诉我服务器已启动并正在运行。当我尝试从主机上的浏览器访问来宾的IP时,只会出现“连接被拒绝”错误。我在另一个Linux安装上尝试过,在那里我可以通过来宾内部的浏览器访问网站,而不能从主机进行访问。我认为发行版会出现问题,因此切换到Ubuntu Server并遇到相同的问题。
知道我在做什么错吗?