में Android-DirectionalViewPager .jar सहित त्रुटि। मैं अपने ऐप में लंबवत स्वाइपिंग को लागू करने की कोशिश कर रहा हूं। (यह ViewPager के साथ स्वाइप करने जैसा है, लेकिन लंबवत है)।ईक्लीप्स
मुझे जेक व्हार्टन लाइब्रेरी Android-DirectionalViewPager मिली। यह एक स्टैंडअलोन .jar फ़ाइल है जिसे संगतता लाइब्रेरी के अतिरिक्त शामिल किया जाना चाहिए। मैंने अपनी परियोजना में फ़ाइल शामिल की। यह अब संगतता लाइब्रेरी की तरह 'संदर्भित पुस्तकालय' के तहत है।
लेकिन समस्या यह है कि, मैं काम करने के लिए लाइब्रेरी के साथ दिया गया उदाहरण भी प्राप्त नहीं कर सकता। डिबगर लाइन
setContentView(R.layout.main);
साथ 'नहीं स्रोत मिला' पर बंद हो जाता
LogCat इस त्रुटि फेंकता है: "05-23 14: 43: 13.583: ई/dalvikvm (329): वर्ग नहीं मिल सका 'com.directionalviewpager.DirectionalViewPager', विधि से संदर्भित है। vvp.MainActivity.onCreate "
क्या कोई इस पुस्तकालय का उपयोग पहले से ही कर चुका है?
प्रकट:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="own.vvp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
लेआउट:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.directionalviewpager.DirectionalViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="2dp"
android:orientation="horizontal">
<Button
android:id="@+id/horizontal"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginRight="1dp"
android:text="Horizontal" />
<Button
android:id="@+id/vertical"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="1dp"
android:text="Vertical" />
</LinearLayout>
</LinearLayout>
और मुख्य गतिविधि:
package own.vvp;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.Button;
import com.directionalviewpager.DirectionalViewPager;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Set up the pager
final DirectionalViewPager pager = (DirectionalViewPager)findViewById(R.id.pager);
pager.setAdapter(new TestFragmentAdapter(getSupportFragmentManager()));
//Bind to control buttons
((Button)findViewById(R.id.horizontal)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pager.setOrientation(DirectionalViewPager.HORIZONTAL);
}
});
((Button)findViewById(R.id.vertical)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pager.setOrientation(DirectionalViewPager.VERTICAL);
}
});
}
}
मैं कुछ मदद :)
यहाँ मेरी कोड है जरूरत
यह एक ही कोड है उदाहरण के तौर पर, पैकेज नाम और मुख्य गतिविधि के नाम को छोड़कर, मुझे लगता है कि जिस तरह से मैंने पुस्तकालय शामिल किया है वह गलत होना चाहिए।
धन्यवाद!
कक्षा आइटमइन्फो – Siddhesh
नहीं ढूंढ पा रहा है सुनिश्चित करें कि आपके पास उचित समर्थन लाइब्रेरी है - आपको 'android.support.v4.view.ViewPager.ItemInfo' तक पहुंच की आवश्यकता है। –
मेरे पास नवीनतम lib – Siddhesh