小编Phi*_*992的帖子

距中心的 CSS 过渡宽度

好的,所以我希望我的容器在父级悬停时从中心打开到指定的宽度。

问题是我无法让它不从左侧打开。我希望它的工作方式与这里的情况类似。

如果可能的话,我希望在完成第一个动画后激活容器角的动画。

body {
  background: #4e4e4e;
}

#music {
  position: absolute;
  top: 5px;
  left: calc(50% - 50px);
  width: 50px;
  height: 50px;
  border: 1px solid white;
  background-color: #000;
  opacity: 1;
  -webkit-transition: all 0.8s ease;
  -moz-transition: all 0.8s ease;
  transition: all 0.8s ease;
}

#music:hover {
  -moz-border-radius: 100px;
  -webkit-border-radius: 100px;
  border-radius: 100px;
}

#music img {
  height: 30px;
  width: 30px;
  margin-top: 10px;
}

#music:hover .music-container {
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  height: 23px;
  width: 210px;
  margin-top: 8px;
  opacity: 1;
  background-color: …
Run Code Online (Sandbox Code Playgroud)

html css

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

将 DateTime 添加到列表会损失 12 小时

我有一个约会时间:

var time = DateTime.Now;
Run Code Online (Sandbox Code Playgroud)

我将时间格式化为我需要的布局。当我将时间添加到列表中时,时间会发生变化。例如 14:00 至 02:00。

List<DateTimeQty> timeList= new List<DateTimeQty>();
timeList.Add(new DateTimeQty(Convert.ToDateTime(time.ToString("yyyy-MM-dd hh:mm:ss"))));
Run Code Online (Sandbox Code Playgroud)

我尝试增加小时,但结果保持不变。例如

time.AddHours(1); 
Run Code Online (Sandbox Code Playgroud)

02:00 进入,02:00 出来,而不是 03:00。我究竟做错了什么?

c# datetime list

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

内联 CSS 图像和段落内联

我无法让我的 div 在同一行上布局图像和段落,我在 stackoverflow 和 google 上搜索了许多主题,但没有灵魂工作。

由于网络主机的原因,我必须使用内联 css 来设置网站的样式。(相信我,我更愿意使用 css 文件,但由于所选的网络主机而无法这样做)

通常我会使用引导程序来实现这一点,但正如所指出的,这不是一个选项。

<div style="display:inline-block; color:black;border: 3px solid #ffd800; margin-bottom: 25px; border-radius: 10px; background-color: #FFF1AD; box-shadow: 13px 15px 6px #2b2626; border-top: 30px solid #ffd800;">
<h1 style="color:black; margin-top: -27px; padding-left: 5px; font-weight:bold;">
          This is a title
  </h1>
  
  <div id="image" style="margin-left: 10px;">
          <img src="https://placehold.it/100x200" width="100" height="200" alt="Image"> 
      </div>
	  
	  <div id="texts" style="float:right;"> 
<p style="color:black; margin-top: 10px;margin-left: 10px; margin-bottom: 10px;  font-size: 120%;">
  
          Here is my content, I am  writting more than I need to …
Run Code Online (Sandbox Code Playgroud)

html css

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

为什么我的活动会自动重启?

我是Android应用程序开发的初学者.最近,开始开发聊天应用程序.我实现了客户端服务器消息交换的基本功能.我正面临一个问题,即android活动会自动重启.因此,会创建一个新的视图实例,但无法在列表视图中看到这些消息.

从跟踪中,我可以看到活动已停止并自动创建.因此,再次创建MAIN活动的新实例.

12-21 14:47:50.744    1913-1913/? I/System.out? **********MainActivity.onCreate()-->com.chat.client.MainActivity@1e611def
12-21 14:48:11.209    1913-1913/chat.com.android_client I/System.out? ********onStop() app is killed!!!
12-21 14:48:11.216    1913-1913/chat.com.android_client I/System.out? **********MainActivity.onCreate()-->com.chat.client.MainActivity@7ea43db
Run Code Online (Sandbox Code Playgroud)

[ MainActivity.java ]

package com.chat.client;

import android.app.Activity;
import android.database.DataSetObserver;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AbsListView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;

import com.chat.client.config.ChatProtocolConstants;
import com.chat.client.config.ServerUriConstants;
import com.chat.client.connect.ChatServerListener;
import com.chat.client.connect.ChatWebSocketHandler;
import com.chat.client.connect.ConnectionManager;

import chat.com.android_client.R;
import de.tavendo.autobahn.WebSocketHandler;


public class MainActivity extends Activity {

    private ChatArrayAdapter chatArrayAdapter;
    private ListView listView;
    private EditText chatEditText;
    private Button …
Run Code Online (Sandbox Code Playgroud)

java android

0
推荐指数
1
解决办法
2517
查看次数

ArrayList不存储值

我是ArrayLists概念的新手.我正在使用它们,因为我想要一个动态数组,其数量不限于它可以按顺序保存多少个值.但我使用的方法不是正确存储值.我只保留一个值为1.我的代码如下:

public void Rand(){
Random rand = new Random();
int Val = rand.nextInt(5); 
ArrayList<Integer> ValList = new ArrayList<Integer>();
ValList.add(Val);
Log.d("LOOK", Integer.toString(ValList));   
Log.i("VALUE LIST ", ValList.size()+" <<<<LIST HERE"); }
Run Code Online (Sandbox Code Playgroud)

此过程在oncreate中调用,然后返回到循环中.理想情况下,每次运行此类时,新的随机数将按顺序添加到数组中.

这是logcat的相关信息:

03-05 19:15:15.020: D/LOOK(21325): 3
03-05 19:15:15.020: I/VALUE LIST(20883): 1 <<<<LIST HERE
03-05 19:15:15.040: D/LOOK(21325): 5
03-05 19:15:15.040: I/VALUE LIST(20883): 1 <<<<LIST HERE
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,即使随机值不是1,它也只存储值1.我使用了错误类型的数组还是错误地实现了它?

我希望看到的输出是这样的:

03-05 19:15:15.020: D/LOOK(21325): 3
03-05 19:15:15.020: I/VALUE LIST(20883): 3 <<<<LIST HERE
03-05 19:15:15.040: D/LOOK(21325): 5
03-05 19:15:15.040: I/VALUE LIST(20883): 3, 5 <<<<LIST HERE
Run Code Online (Sandbox Code Playgroud)

java random android arraylist logcat

0
推荐指数
1
解决办法
1165
查看次数

标签 统计

android ×2

css ×2

html ×2

java ×2

arraylist ×1

c# ×1

datetime ×1

list ×1

logcat ×1

random ×1