Comments (6)
The same problem
from android-stepsview.
if size 2 index are 0 , 1
from android-stepsview.
The same , who solved this problem?
from android-stepsview.
我解决了这个问题,关键是这个函数导致的 public void onSizeChanged(int w, int h, int oldw, int oldh) ,详情请加qq群联系151909524。
from android-stepsview.
public void setStepSize(int size) {
mNumOfStep = size;
refreshSizePosition();//每次设置的时候,重新计算 mThumbContainerXPosition
invalidate();
}
@OverRide
public void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
//refreshSizePosition();//这一行必须注释掉
}
private void refreshSizePosition() {
mCenterY = 0.5f * getHeight();
mLeftX = mPadding;
mLeftY = mCenterY - (mLineHeight / 2);
mRightX = getWidth() - mPadding;
mRightY = 0.5f * (getHeight() + mLineHeight);
mDelta = (mRightX - mLeftX) / (mNumOfStep - 1);
// if (mThumbContainerXPosition.size()>0)mThumbContainerXPosition.clear();
mThumbContainerXPosition.add(mLeftX);
for (int i = 1; i < mNumOfStep - 1; i++) {
mThumbContainerXPosition.add(mLeftX + (i * mDelta));
}
mThumbContainerXPosition.add(mRightX);
mDrawListener.onReady();
}
from android-stepsview.
如果不采取上面的方法, mStepsView.setCompletedPosition(position%labels.length)
.setLabels(labels)
.setBarColorIndicator(
ct.getResources().getColor(R.color.light_gray))
.setProgressColorIndicator(ct.getResources().getColor(R.color.orange))
.setLabelColorIndicator(ct.getResources().getColor(R.color.orange))
.drawView();
需要初始化一次,然后从网络取数据的时候,再执行一次,如果采取上述的解决方案,
就不需要初始化一次,直接网络加载完毕执行一段这样的代码,加载数据就可以;
from android-stepsview.
Related Issues (20)
- Change label position to below the circle HOT 1
- Thumbs doubled when device rotates
- Cannot set long text
- use TypeFace for labels
- Error:No such property: POM_ARTIFACT_ID for class: org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer HOT 4
- Adding a stroke or an alternative
- How to change position dynamically
- Can I set the vertical mode?How?
- How to Hide the Label HOT 1
- Error:Could not find method mavenDeployer() for arguments [maven_push_3wvhvyhz4ektmmr62gf3d5vog$_run_closure1_closure2_closure8_closure9@52430312] on repository container.
- Please update the app to latest gradle and version.
- Change font family of Label
- How set float value as setCompletedPosition?
- RTL
- First label appears bold HOT 1
- How to make stepsView vertical instead of hotizental ? HOT 1
- New line label
- How to make StepsView scroll horizontal HOT 1
- how to set indicator clicked listener HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-stepsview.