小编Bin*_*Man的帖子

如何在读取问候包时修复错误?

我正在尝试连接到 NetBeans 中的服务器。我写的代码如下:

<?php
echo "wlecome";
echo "<br>";

$conn=mysqli_connect("mydomain.com:2082", "phpmyadmin_user", "password","database_name");
                     
echo $conn;
?>
Run Code Online (Sandbox Code Playgroud)

运行此代码会返回此错误:

wlecome

Warning: mysqli_connect(): MySQL server has gone away in C:\xampp\htdocs\myprojet\index.php on line 10

Warning: mysqli_connect(): Error while reading greeting packet. PID=1092 in C:\xampp\htdocs\myprojet\index.php on line 10

Warning: mysqli_connect(): (HY000/2006): MySQL server has gone away in C:\xampp\htdocs\myprojet\index.php on line 10

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\myprojet\index.php on line 10
Run Code Online (Sandbox Code Playgroud)

php mysqli

8
推荐指数
1
解决办法
3万
查看次数

将ImageView对齐到LinearLayout的右下角

我正在试图将一个ImageView放在LinearLayout的右下角....我把代码编写为:

style.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="90dp"
        android:background="@drawable/my_background"
        android:orientation="horizontal" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|right"
            android:src="@drawable/my_small_image" />

        </LinearLayout>

    <ListView  
        android:id="@android:id/list"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"/>

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

此代码导致右下角的ImageView"my_small_image",但我需要在左下角.有人对此有什么想法吗?

我希望这里有人可以帮助我.

最好的问候和提前感谢,Fadel.

android android-layout

3
推荐指数
3
解决办法
2万
查看次数

在relativelayout中关联2小部件时出错

我试图关联小部件,我写下如下代码:

<RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="90dp"
        android:background="@drawable/ad1"
        android:orientation="horizontal" >

        <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/ad1"
        android:orientation="horizontal"
        android:layout_toStartOf="@id/bt_menu" > // here there is error !!!!

        <EditText
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:hint="Menu "
        android:inputType="textVisiblePassword"/>
            </RelativeLayout>

        <ImageButton 
                 android:id="@+id/bt_menu" 
                 android:layout_width="50dp"
                 android:layout_height="50dp" 
                 android:layout_alignParentRight="true"
                 android:layout_alignParentTop="true"
                 android:background="@android:color/transparent"
                 android:scaleType="fitCenter" 
                 android:src="@drawable/menu5"
                 android:onClick="menu_onclick"/>
        </RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

我在这行中有错误:

机器人:layout_toStartOf = "@ ID/bt_menu"

错误是:找不到与给定名称匹配的资源(在'layout_toStartOf'中,值为'@id/bt_menu')

任何人都可以帮助我!!!!

提前谢谢.. Fadel.

android relativelayout

2
推荐指数
1
解决办法
820
查看次数

标签 统计

android ×2

android-layout ×1

mysqli ×1

php ×1

relativelayout ×1