小编use*_*368的帖子

imagebutton给我错误:[辅助功能]图像上缺少contentDescription属性

[辅助功能]图像上缺少contentDescription属性

这个错误意味着什么,我该如何解决?

<ImageButton
    android:id="@+id/callbannerbuttonpg1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="157dp"
    android:background="@null"
    android:src="@drawable/callbanner"
    android:visibility="invisible" />
Run Code Online (Sandbox Code Playgroud)

android accessibility imagebutton

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

如何在没有内存耗尽的情况下在机器人中制作拼图应用程序?

我注意到来自谷歌游戏商店的其他拼图应用程序可以达到多达400个单独的可移动拼图

我一直试图学习如何至少拍摄一个代表我的谜题的图像,裁剪某些部分并遮盖留下拼图设计的图像空间,以便创建我个人的拼图

我想为我的应用程序最多20件,但到目前为止,根据我的android工作室内存日志,一旦位图工厂完成创建一个拼图块我用尽了大约18mb的内存,之后创建了20件与所有其他应用程序的功能我正在使用400 + mb的内存,我必须使用"largeHeap = true"以防止内存耗尽,但我已经接近超出应用程序超级缓慢且足够的限制动画活动将不可避免地导致应用程序崩溃

我很想知道那些其他游戏商店拼图应用程序正在做什么,我不是

非常感谢任何输入

仅供我使用PNG24作为我的图像,测试图像的尺寸为556x720

这是一个例子,如果我只是创建一个动画能力拼图图像

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);//Remove title bar
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//Hides notification bar
    this.setContentView(R.layout.activity_main);//set content view AFTER ABOVE sequence (to avoid crash)

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

    mainDisplay = getWindowManager().getDefaultDisplay();
    mainLayout = (ViewGroup) findViewById(R.id.id_layout);

    DisplayMetrics m = new DisplayMetrics();
    this.getWindowManager().getDefaultDisplay().getMetrics(m);
    int windowHeight = m.heightPixels;
    int windowWidth = m.widthPixels;

    offsetX = (windowWidth / 1440.0f);
    offsetY = (windowHeight / 2560.0f);

    ourContext = this;

    xpos = new float[2];
    ypos = new float[2];

    iv_PuzzleOne();

    bkgdbm = …
Run Code Online (Sandbox Code Playgroud)

puzzle android crop porter-duff android-bitmap

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

Imageview在屏幕边缘缩小

如果我想将我的ImageView到图像的右侧的一部分将延伸超过可见屏幕上的图像趋于萎缩,所有的图像往往停留在屏幕的边缘内的位置,同样可以如果我降低图像以延伸超出屏幕底部,图像会缩小并且不会延伸超过屏幕的下边缘,

然而,如果我向上移动图像的位置或向左移动图像大小没有收缩并且图像像我想要的那样延伸到屏幕之外,我很好奇是否有任何建议我如何解决这个问题而不是你

    mainLayout = (ViewGroup)findViewById(R.id.id_layout);

    deviceScreenSize = new Point();

    thisContext = this;

    mainDisplay = getWindowManager().getDefaultDisplay();
    mainDisplay.getSize(deviceScreenSize);
    offsetX = (deviceScreenSize.x / 320.0f);
    offsetY = (deviceScreenSize.y / 568.0f);

    mainIMG = new ImageView(this);
    mainIMG.setImageDrawable(getResources().getDrawable(R.drawable.myimg));
    SetPos(0, 0, 320, 568);
    mainIMG.setLayoutParams(layoutPositioner);
    mainLayout.addView(mainIMG);

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

}

public void SetPos(float x, float y, float width, float height) {
    layoutPositioner = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
    layoutPositioner.topMargin = (int)(y * offsetY);
    layoutPositioner.leftMargin = (int)(x * offsetX);
    layoutPositioner.width = (int)(width * offsetX);
    layoutPositioner.height = (int)(height * offsetY);
}

public void SetPosWithoutOffset(float x, …
Run Code Online (Sandbox Code Playgroud)

android imageview

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