小编Moh*_*j S的帖子

在片段中添加Google Maps API V2

我正试图在片段中显示来自Google Maps API V2的地图.我尝试使用SupportMapFragment,但我无法获得预期的输出.我也是这个平台的初学者!我真正想要的只是一种将Google Maps API V2 for Android中的地图放入片段中的方法.请分享您的想法和参考.

提前致谢 !

android google-maps android-fragments

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

如何使用故事板通过自定义图像设置iPhone标签栏图标

我是iphone开发的新手,我需要在标签栏中放置一个自定义图像图标.但它只显示默认颜色(黑色和蓝色).帮助我克服这个bug朋友......?

iphone uitabbarcontroller uitabbar ios xcode4.5

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

faceview for camera在android lollipop os中不起作用

今天我在android中遇到了一个问题surfaceview for camera customization.我尝试了下面的代码.

拍摄图像时出现问题,它会停止相机预览并且不会返回活动.

以下代码将在程序中实现.我从stackoverflow上的现有引用中获取此代码

  1. 支持班级.

    public class AndroidCameraSurfaceview extends Activity implements
        SurfaceHolder.Callback {
    TextView testView;
    
    Camera camera;
    SurfaceView surfaceView;
    SurfaceHolder surfaceHolder;
    boolean preview;
    
    PictureCallback rawCallback;
    ShutterCallback shutterCallback;
    PictureCallback jpegCallback;
    int displayheight, displaywidth;
    Camera.PreviewCallback previewCallback;
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.camerasurfaceview);
    
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        surfaceView = (SurfaceView) findViewById(R.id.surfaceView);
        surfaceHolder = surfaceView.getHolder();
    
        surfaceHolder.addCallback(this);
    
        surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
    
        jpegCallback = new PictureCallback() {
            public void onPictureTaken(byte[] data, Camera camera) {
                Bundle …
    Run Code Online (Sandbox Code Playgroud)

android android-intent android-camera android-5.1.1-lollipop

15
推荐指数
3
解决办法
4099
查看次数

如何解决MMUMapper错误?

我是Android App开发的新手.

我正在我的应用程序中实现GCM(Google Cloud Messaging).

当我尝试将值发布到我的URL时,我收到一个错误:

the Stack Trace Error and MMUMapper Error, fail to register MVA, unsupported format(0x5) and invalid operation for Unregister MVA with VA.
Run Code Online (Sandbox Code Playgroud)

有没有人有办法解决吗?请帮助我.

android google-cloud-messaging

11
推荐指数
1
解决办法
1106
查看次数

约束布局问题java.lang.AssertionError:TOP

我开始使用约束布局,仅在编译设计文件时遇到断言错误,就会发生此问题。解决此问题的正确方法是什么?我搞砸了一天。这是我的XML设计。

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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/cL_Layout"
    android:layout_width="match_parent"
    android:layout_height="80dp"
    android:background="@color/card_background">

    <android.support.constraint.Guideline
        android:id="@+id/gL_right_margin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.95" />

    <android.support.constraint.Guideline
        android:id="@+id/gL_vertical_center"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.50364965" />
    <android.support.constraint.Guideline
        android:id="@+id/gL_bottom_margin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="1.0" />

    <android.support.constraint.Guideline
        android:id="@+id/gL_image_size_margin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.3" />


    <ImageView
        android:id="@+id/imgVw_AddClips_recVw_icon"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="4dp"
        android:layout_marginStart="4dp"
        android:layout_marginTop="4dp"
        android:adjustViewBounds="true"
        android:background="@drawable/qik_highlights_shape"
        android:contentDescription="@string/dummy_content"
        android:scaleType="fitCenter"
        android:src="@drawable/bg_cloud_icon"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/gL_image_size_margin"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />


    <com.ibot.cyranoapp.customview.TextViewFont
        android:id="@+id/txtIp_recVw_AddClips_Name_title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:text="@string/recVw_Template_channel"
        android:textAllCaps="false"
        android:textColor="@color/fa_preview_button_text_grey"
        android:textSize="14sp"
        android:textStyle="bold"
        app:layout_constraintStart_toEndOf="@+id/gL_image_size_margin"
        app:layout_constraintTop_toTopOf="parent" />


    <com.ibot.cyranoapp.customview.TextViewFont
        android:id="@+id/txtIp_recVw_Components_Name_title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_marginStart="8dp"
        android:text="@string/recVw_Template_Components"
        android:textAllCaps="false" …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-constraintlayout

8
推荐指数
2
解决办法
2607
查看次数

为什么 Android OS-10 中的 ExoPlayer 在预览时显示黑色预览屏幕

我正在使用 Exoplayer 以横向模式录制视频并以纵向模式显示预览,同时连续录制视频,更改方向,反之亦然。一旦进入,播放器预览就会显示空白屏幕。我使用 Exoplayer 2.9.6 作为 Gradle 的依赖项并使用 android 操作系统版本 10。

E/BufferQueueProducer:[SurfaceTexture-0-22659-29] setMaxDequeuedBufferCount:请求的缓冲区计数 2 小于最小值 3

E/Surface:IGraphicBufferProducer::setBufferCount(2) 返回无效参数 E/ACodec:native_window_set_buffer_count 失败:无效参数 (22)

E/ExoPlayerImplInternal:内部运行时错误。java.lang.IllegalArgumentException 在 android.media.MediaCodec.native_setSurface(本机方法) 在 android.media.MediaCodec.setOutputSurface(MediaCodec.java:2042) 在 com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setOutputSurfaceV23(MediaCodecVideoRenderer.java :1014)在com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setSurface(MediaCodecVideoRenderer.java:422)在com.google.android.exoplayer2.video.MediaCodecVideoRenderer.handleMessage(MediaCodecVideoRenderer.java:387)在com.google。 android.exoplayer2.ExoPlayerImplInternal.deliverMessage(ExoPlayerImplInternal.java:864) 在 com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageToTarget(ExoPlayerImplInternal.java:835) 在 com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageInternal(ExoPlayerImplInternal.java: 817) 在 com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:330) 在 android.os.Handler.dispatchMessage(Handler.java:103) 在 android.os.Looper.loop(Looper.java:237) )在 android.os.HandlerThread.run(HandlerThread.java:67)

java android exoplayer

7
推荐指数
1
解决办法
1536
查看次数

可达性问题ios6

在应用程序中显示ios6中的可达性错误.任何人都可以帮我解决可达性ios6中的这个错误,需要做的事情.

@implementation Reachability
 static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)
 {
#pragma unused (target, flags)
NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback");
NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCall9back");

//We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively
// in case someon uses the Reachablity object in a different thread.


Reachability* noteObject = (Reachability*) info;
// Post a notification to notify the client that the network reachability changed. …
Run Code Online (Sandbox Code Playgroud)

iphone ios6

5
推荐指数
1
解决办法
670
查看次数

在Android中输入类android.support.design.widget.FloatingActionButton时出错

当我尝试构建应用程序时,它将显示android.view.InflateException在FloatingActionButton中?我真的不知道导致错误的原因.

Login.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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:background="@drawable/bg_image" >
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/lLayout_logincontainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_margin="40dp"
        android:orientation="vertical">
        <ImageView
            android:layout_width="130dp"
            android:layout_height="125dp"
            android:src="@drawable/project"/>

        <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp">


            <EditText
                android:id="@+id/aTxt_UserName"
                style="@style/edittextstyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="User Name"
                android:imeOptions="actionNext"
                android:textColorHint="@color/white"
                >

            </EditText>


        </android.support.design.widget.TextInputLayout>

        <!--  Password Label -->
        <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:layout_marginTop="8dp">

            <EditText
                android:id="@+id/eTxt_PassWord"
                style="@style/edittextstyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Password"
                android:inputType="textPassword"
                android:textColorHint="@color/white"
                android:textColor="@color/white" />

        </android.support.design.widget.TextInputLayout>

        <android.support.v7.widget.AppCompatButton
            android:id="@+id/btn_login"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="left"
            android:layout_marginTop="3dp"
            android:background="@drawable/button_shape"
            android:padding="12dp"
            android:text="Login"
            android:textAllCaps="false"
            android:textColor="#ffffff" />
    </LinearLayout>


</RelativeLayout> …
Run Code Online (Sandbox Code Playgroud)

android android-layout floating-action-button android-api-levels

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

导航栏按钮未显示

当试图在左侧和右侧添加导航按钮时,它没有显示?这是我用过的代码,这有什么不对吗?

这是我在appdelegate中添加导航栏的方式,

  UIViewController *viewController1 = [[logyFirstViewController alloc] initWithNibName:@"logyFirstViewController" bundle:nil];
  UIViewController *viewController2 = [[logySecondViewController alloc] initWithNibName:@"logySecondViewController" bundle:nil];
  UIViewController *viewController3 = [[record alloc] initWithNibName:@"record" bundle:nil];
  UIViewController *viewController4 = [[searchview alloc] initWithNibName:@"searchview" bundle:nil];
  UIViewController *viewController5 = [[profilde alloc] initWithNibName:@"profilde" bundle:nil];
 self.tabBarController = [[UITabBarController alloc] init];

self.tabBarController.viewControllers = @[viewController1, viewController2, viewController3, viewController4, viewController5];
navigationController = [[UINavigationController alloc] initWithRootViewController:self.tabBarController];

self.navigationController.navigationBar.barStyle=UIBarStyleDefault;

[navigationController.navigationBar setAlpha:0.8f];
 [self.window addSubview:[navigationController view]];





 button4 = [UIButton buttonWithType:UIButtonTypeCustom];
 [button4 setFrame:CGRectMake(0.0f, 0.0f, 25.0f, 25.0f)];
 [button4 addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
 [button4 setImage:[UIImage imageNamed:@"del.png"] forState:UIControlStateNormal];
 UIBarButtonItem *random1 = …
Run Code Online (Sandbox Code Playgroud)

iphone uinavigationcontroller ios6

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

我无法在 android studio 2.3 的 Project Explorer 中以拆分视图查看包

我使用 Ubuntu 16.04 进行 android 开发,最近我从稳定频道更新了 Android Studio 2.3。目前我从 IDE 中发现了一些错误。下面提到了错误:我创建了新项目,项目资源管理器中显示的包和类文件非常奇怪。请参阅下面的图片,它们将清楚地传达我想说的内容。如何更改包在资源管理器中显示的模式。

android studio 包没有在分割模式下显示

我期望在资源管理器中看到这种视图,请参阅下面的图片 Android Studio-2.2 包资源管理器

android android-studio android-studio-2.3

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

java 类如何在 WebLogic 12c 中定位并加载静态 pdf 文件?

我需要从 java 类加载一个静态 PDF 文档,该文档在 WebLogic 12c 上的 J2EE Web 应用程序中运行;然而,尽管我的代码可以在 Tomcat 中运行,但当尝试在 WebLogic 12c(WebLogic Server 版本:12.2.1.2.0)中运行它时,我收到一个服务器错误,指出找不到 PDF 文件(java.io.FileNotFoundException)。

我正在使用 Apache 的 PDF 库 PDFBox 版本 2.0.8 加载我创建的可填写 PDF 文件,然后用数据填充该可填写 PDF。我的代码在 Tomcat 中运行良好,但在部署到 WebLogic 12c 时找不到 pdf 文件。

-这似乎是因为当 EAR 文件部署到 WebLogic 12c 时,WAR 文件中的内容(所有应用程序代码/文件,包括可填写的 PDF 文件)仍然存档在 WebLogic 创建的 jar 文件中,而不是爆炸了。

我的应用程序使用标准的 Maven 应用程序结构,因此与所有静态文件都是标准的,我已将 PDF 文件放在静态资源目录中:

src/主/资源/

在我的 pom.xml 文件中,我有以下内容,它将 /src/main/resources/ 文件夹中的所有 pdf 文件构建到 WAR 文件的类路径根文件夹中。

<resource>
    <directory>${basedir}/src/main/resources/</directory>
        <includes>
        <include>**/*.xml</include>
        <include>**/*.properties</include>
       <include>**/*.pdf</include>
    </includes>
</resource>
Run Code Online (Sandbox Code Playgroud)

当我构建 WAR 和 EAR 文件时,pdf 文件确实被复制到应用程序类文件的根文件夹中。 …

pdfbox weblogic12c

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

对于自定义单元格,UITableView错误"无法在bundle中加载NIB:"

当我尝试使用以下自定义单元格编码时,它显示错误.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *simpleTableIdentifier = @"SimpletablcellCell";
    SimpletablcellCell *cell = (SimpletablcellCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
    if (cell == nil)
    {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpletablcellCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }

    cell.nameLabel.text = [ar objectAtIndex:indexPath.row];
    cell.thumbnailImageView.image = [UIImage imageNamed:[ar1 objectAtIndex:indexPath.row]];
    cell.prepTimeLabel.text = [ar objectAtIndex:indexPath.row];

    return cell;
}
Run Code Online (Sandbox Code Playgroud)

错误消息

'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/apple/Library/Application Support/iPhone Simulator/6.0/Applications/FE02B3A1-C40C-4FAC-BBA6-B245350F3754/SImpleTab.app> (loaded)' with name 'SimpletablcellCell''
 *** First throw call stack:
(0x1c8f012 0x10cce7e 0x1c8edeb 0x22ffac 0x23198d …
Run Code Online (Sandbox Code Playgroud)

iphone uitableview ios

0
推荐指数
2
解决办法
9805
查看次数

如何在android中从一个类调用arraylist变量到另一个类

如何ArrayList在android中将变量从一个类调用到另一个类?我构架了ArrayListfrom Json Service,我尝试了很多方法,但是在如何将数组列表从一个类调用到另一个类时遇到了问题。我使用以下代码来构建数组列表HashMap

下面显示的是 FirstActivityCLass

protected Integer doInBackground(Void... arg0) {

            try {
                
                JSONObject e = null;
                System.out.println("In Background...");
                StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
                        .detectAll().penaltyLog().build();
                StrictMode.setThreadPolicy(policy);
                String API = "http://traininglabs.com/nic/a-remainders-list.php?email="+email;
                System.out.println(API);
                JSONObject loginjson = JSONfunctions1.getJSONfromURL(API);
                responseArray=loginjson.getJSONArray("user");
                
                mylist=new ArrayList<HashMap<String,String>>();
                for (int i = 0; i < responseArray.length(); i++)
                        {
                    map = new HashMap<String, String>();                     

                JSONObject obj= responseArray.getJSONObject(i);

                    **String ss = obj.getString("id");
                    map.put("id", obj.getString("id"));**
                    map.put("state", obj.getString("status"));
                    map.put("entity", obj.getString("company"));
                    map.put("date", obj.getString("adate"));
                     s1 = e.getString("state");
                     s2 = e.getString("entity");
                     s3 …
Run Code Online (Sandbox Code Playgroud)

java android json arraylist hashmap

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