ورود

View Full Version : مشکل سرعت پایین و تیک زدن هنگام اسکرول



esmail3309
چهارشنبه 26 آذر 1393, 19:09 عصر
سلام دوستان

نمیدونم چرا توی یکی از اکتیویتی هام که عناصری مختلفی توش قرا دادم هنگام اسکرول کردن بد جوری تیک میزنه!!!!

این کد اکتیویتیش:

package com.sasan_ah.settings;




import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.ZoomControls;

public class tozihat_1 extends Activity{



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENT ATION_PORTRAIT);
setContentView(R.layout.layout_tozihat_1);



Button back = (Button)findViewById(R.id.button2);



back.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {


finish();

}
});






final TextView t_smsBody = (TextView) findViewById(R.id.txt);

Button news = (Button)findViewById(R.id.textView2);
news.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://cafebazaar.ir/app/com.example.coocklearn/?l=fa"));
startActivity(browserIntent);
}
});








Button btnSHare = (Button) findViewById(R.id.button1);

btnSHare.setOnClickListener(new OnClickListener() {









@Override
public void onClick(View arg0) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT,t_smsBody.g etText().toString());
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "iran");
startActivity(Intent.createChooser(shareIntent, "اشتراک گزاری با ..."));

}
});


}


}




اینم کد لایوتش:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_6"
android:gravity="center_horizontal"
android:orientation="horizontal" >

<ScrollView
android:id="@+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="90dp" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:src="@drawable/w"
/>

<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:src="@drawable/u"
/>




<FrameLayout
android:id="@+id/framelayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

<ImageView
android:id="@+id/imageView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="5dp"
android:src="@drawable/mavad_3" />






<TextView
android:id="@+id/textView1"
android:layout_width="310dp"
android:layout_height="229dp"
android:layout_gravity="center"
android:layout_marginBottom="20dp"
android:layout_marginRight="2dp"
android:layout_marginTop="20dp"
android:text="تست"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#5b3e49" />

</FrameLayout>



<com.sasan_ah.settings.CustomTextView
android:id="@+id/txt"
android:layout_width="fill_parent"
android:layout_height="607dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="25dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginTop="10dp"
android:background="@drawable/tahye_3"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="تست"
android:textColor="#000000" />


<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:src="@drawable/e"
/>
<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:src="@drawable/r"
/>
<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:src="@drawable/t"
/>
<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:src="@drawable/y"
/>



<com.sasan_ah.settings.CustomTextView
android:id="@+id/txt"
android:layout_width="fill_parent"
android:layout_height="607dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="25dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginTop="10dp"
android:background="@drawable/tahye_3"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="تست"
android:textColor="#000000" />
</LinearLayout>
</ScrollView>

<Button
android:id="@+id/button1"
android:layout_width="50dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:alpha="0.8"
android:background="@drawable/icon_4" />

<Button
android:id="@+id/button2"
android:layout_width="50dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/left"
android:onClick="shareData" />

<ImageView
android:id="@+id/imageView1"
android:layout_width="175dp"
android:layout_height="30dp"
android:layout_alignTop="@+id/button1"
android:layout_centerHorizontal="true"
android:src="@drawable/news_green" />

<Button
android:id="@+id/textView2"
android:layout_width="175dp"
android:layout_height="30dp"
android:layout_alignLeft="@+id/imageView1"
android:layout_alignTop="@+id/imageView1"
android:background="@drawable/news_green"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="آش دونی"
android:textColor="#51bf87"
android:textSize="19sp" />

<ImageView
android:id="@+id/imageView2"
android:layout_width="31dp"
android:layout_height="31dp"
android:layout_alignBottom="@+id/imageView1"
android:layout_alignRight="@+id/imageView1"
android:layout_marginBottom="2dp"
android:src="@drawable/coock" />

</RelativeLayout>








فقط یه نکته ای بگم که از طریق تنظیمات درون برنامم مشخصات متون <com.sasan_ah.settings.CustomTextView هارو میشه تغیر داد (گفتم شاید اینم مهم باشه)

دوستان لطفا یه راهنمایی بکنید کل برنامم درسته و فقط منتظر همین مشکلو هستم