我正在学习构建Android应用程序,我需要一些特定的帮助.我似乎无法理解我需要更改哪些模板代码,以及哪些位是静态的.
在LAYOUT文件夹中,我有我的ACTIVITY_MAIN.XML读取
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/main_buttons_photos" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
接下来,我有我的第二个活动ACTIVITY_SEND_PHOTOS.XML这是
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".SendPhotos" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="@string/title_activity_send_photos"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
然后我有我的MainActivity.java(这是.class?)这个包com.example.assent.bc;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu …Run Code Online (Sandbox Code Playgroud) 我有一些菜单栏,目前,当悬停在一个时,背景变为黑色
<li>content</li>
Run Code Online (Sandbox Code Playgroud)
当它悬停在上面时,文本从黑色变为白色.
我需要做到这一点,以便在整体<li>content</li>悬停时文本颜色发生变化,而不仅仅是文本突出显示时.
这是css
<style type="text/css">
body{margin:0px; font-family:Tahoma, Sans-Serif; font-size:13px;}
/* dock */
#dock{margin:0px; padding:0px; list-style:none; position:fixed; top:0px; height:100%;
z-index:100; background-color:; left:0px;}
#dock > li {width:40px; height:120px; margin: 0 0 1px 0; background-color:#;
background-repeat:no-repeat; background-position:left center;}
#dock #Menu {background-image:url(Menu.png);}
#dock > li:hover {background-position:-40px 0px;}
/* panels */
#dock ul li {padding:5px; border: solid 0px #879b17;}
#dock ul li:hover {padding:5px;
background:#879b17 url(item_bkg.png) repeat-x;
border: solid 0x #879b17;
font-weight: bold;
color: #000;
}
#dock ul li.header, #dock ul li …Run Code Online (Sandbox Code Playgroud) 想要拍摄照片,裁剪并将图像保存在Android应用程序中时,我在Java中使用以下意图...
Intent camera=new Intent();
camera.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
camera.putExtra("crop", "true");
camera.putExtra("outputX",600);
camera.putExtra("outputY", 600);
camera.putExtra("aspectX", 1);
camera.putExtra("aspectY", 1);
camera.putExtra("scale", true);
camera.putExtra("return-data", false);
Run Code Online (Sandbox Code Playgroud)
上述意图效果很好,但我的Y和X总是相等的.我打算分解代码,找出指定的内容,这样我就可以为我拍摄的图像制作可定制的 - 最重要的是独立的 - X和Y值...
android crop android-camera android-camera-intent resize-crop
我正在尝试加载相机从我的Android应用程序拍摄照片,
我的Photos.java是
private Uri imageUri;
public void takePhoto(View view) {
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
File photo = new File(Environment.getExternalStorageDirectory(), "Pic.jpg");
intent.putExtra(MediaStore.EXTRA_OUTPUT,
Uri.fromFile(photo));
imageUri = Uri.fromFile(photo);
startActivityForResult(intent, TAKE_PICTURE);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case TAKE_PICTURE:
if (resultCode == Activity.RESULT_OK) {
Uri selectedImage = imageUri;
getContentResolver().notifyChange(selectedImage, null);
ImageView imageView = (ImageView) findViewById(R.id.ImageView);
ContentResolver cr = getContentResolver();
Bitmap bitmap;
try {
bitmap = android.provider.MediaStore.Images.Media
.getBitmap(cr, selectedImage);
imageView.setImageBitmap(bitmap);
Toast.makeText(this, selectedImage.toString(),
Toast.LENGTH_LONG).show(); …Run Code Online (Sandbox Code Playgroud) 可能重复:
不推荐使用函数eregi()
我已经用PHP创建了一个联系表单,但是我收到了警告:
不推荐使用:函数eregi()在第9行的D:\ hosting\9606426\html\Websites\LuxeBeauty\1\contact.php中已弃用
这是第9行:
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-
z]{2,}"."$",$email )){
...
}
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能解决这个问题?